Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
8deda7bd
Commit
8deda7bd
authored
May 19, 2020
by
Ulrich Sibiller
Committed by
Mike Gabriel
Oct 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nxagent: Prevent resize loop
This only happened with certain window managers like mutter. Fixes ArcticaProject/nx-libs#925
parent
abe5e847
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
19 deletions
+35
-19
Events.c
nx-X11/programs/Xserver/hw/nxagent/Events.c
+13
-6
Extensions.c
nx-X11/programs/Xserver/hw/nxagent/Extensions.c
+2
-2
Reconnect.c
nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
+1
-1
Screen.c
nx-X11/programs/Xserver/hw/nxagent/Screen.c
+15
-6
Screen.h
nx-X11/programs/Xserver/hw/nxagent/Screen.h
+2
-2
Window.c
nx-X11/programs/Xserver/hw/nxagent/Window.c
+2
-2
No files found.
nx-X11/programs/Xserver/hw/nxagent/Events.c
View file @
8deda7bd
...
...
@@ -588,7 +588,7 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen)
nxagentLaunchDialog
(
DIALOG_ENABLE_DESKTOP_RESIZE_MODE
);
nxagentChangeScreenConfig
(
0
,
nxagentOption
(
Width
),
nxagentOption
(
Height
));
nxagentChangeScreenConfig
(
0
,
nxagentOption
(
Width
),
nxagentOption
(
Height
)
,
True
);
if
(
nxagentOption
(
ClientOs
)
==
ClientOsWinnt
)
{
...
...
@@ -2082,7 +2082,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
X
.
xmap
.
window
==
nxagentDefaultWindows
[
nxagentScreen
(
X
.
xmap
.
window
)
->
myNum
])
{
nxagentChangeScreenConfig
(
nxagentScreen
(
X
.
xmap
.
window
)
->
myNum
,
nxagentOption
(
Width
),
nxagentOption
(
Height
));
nxagentOption
(
Height
)
,
True
);
}
break
;
...
...
@@ -3412,9 +3412,16 @@ int nxagentHandleConfigureNotify(XEvent* X)
fprintf
(
stderr
,
"%s: Width %d Height %d.
\n
"
,
__func__
,
nxagentOption
(
Width
),
nxagentOption
(
Height
));
#endif
/*
* we are processing a ConfigureNotifyEvent that brought us
* the current window size. If we issue a XResizeWindow()
* again with these values we might end up in loop if the
* window manager adjusts the size, which is perfectly
* legal for it to do. So we prevent the XResizeWindow call
* from happening.
*/
nxagentChangeScreenConfig
(
0
,
nxagentOption
(
Width
),
nxagentOption
(
Height
));
nxagentOption
(
Height
)
,
False
);
}
}
...
...
@@ -3435,7 +3442,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
nxagentChangeOption
(
RootHeight
,
X
->
xconfigure
.
height
);
nxagentChangeScreenConfig
(
0
,
nxagentOption
(
Width
),
nxagentOption
(
Height
));
nxagentOption
(
Height
)
,
True
);
return
1
;
}
...
...
@@ -4310,7 +4317,7 @@ int nxagentHandleRRScreenChangeNotify(XEvent *X)
#endif
nxagentResizeScreen
(
screenInfo
.
screens
[
DefaultScreen
(
nxagentDisplay
)],
Xr
->
width
,
Xr
->
height
,
Xr
->
mwidth
,
Xr
->
mheight
);
Xr
->
mwidth
,
Xr
->
mheight
,
True
);
nxagentShadowCreateMainWindow
(
screenInfo
.
screens
[
DefaultScreen
(
nxagentDisplay
)],
screenInfo
.
screens
[
0
]
->
root
,
Xr
->
width
,
Xr
->
height
);
...
...
nx-X11/programs/Xserver/hw/nxagent/Extensions.c
View file @
8deda7bd
...
...
@@ -378,7 +378,7 @@ int nxagentRandRSetConfig(ScreenPtr pScreen, Rotation rotation,
*/
int
r
=
nxagentResizeScreen
(
pScreen
,
pSize
->
width
,
pSize
->
height
,
pSize
->
mmWidth
,
pSize
->
mmHeight
);
pSize
->
mmWidth
,
pSize
->
mmHeight
,
True
);
nxagentMoveViewport
(
pScreen
,
0
,
0
);
...
...
@@ -448,7 +448,7 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
nxagentChangeOption
(
Height
,
height
);
}
int
result
=
nxagentResizeScreen
(
pScreen
,
width
,
height
,
mmWidth
,
mmHeight
);
int
result
=
nxagentResizeScreen
(
pScreen
,
width
,
height
,
mmWidth
,
mmHeight
,
True
);
if
(
result
==
1
&&
nxagentOption
(
DesktopResize
)
==
1
&&
nxagentOption
(
Fullscreen
)
==
0
&&
nxagentOption
(
AllScreens
)
==
0
)
...
...
nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
View file @
8deda7bd
...
...
@@ -633,7 +633,7 @@ Bool nxagentReconnectSession(void)
if
(
nxagentResizeDesktopAtStartup
||
nxagentOption
(
Rootless
)
==
True
||
nxagentOption
(
Xinerama
)
==
True
)
{
nxagentChangeScreenConfig
(
0
,
nxagentOption
(
RootWidth
),
nxagentOption
(
RootHeight
));
nxagentOption
(
RootHeight
)
,
True
);
nxagentResizeDesktopAtStartup
=
False
;
}
...
...
nx-X11/programs/Xserver/hw/nxagent/Screen.c
View file @
8deda7bd
...
...
@@ -2243,7 +2243,7 @@ static void nxagentSetRootClip (ScreenPtr pScreen, Bool enable)
}
Bool
nxagentResizeScreen
(
ScreenPtr
pScreen
,
int
width
,
int
height
,
int
mmWidth
,
int
mmHeight
)
int
mmWidth
,
int
mmHeight
,
Bool
doresize
)
{
#ifdef TEST
nxagentPrintAgentGeometry
(
"Before Resize Screen"
,
"nxagentResizeScreen:"
);
...
...
@@ -2365,10 +2365,19 @@ FIXME: We should try to restore the previously
{
nxagentSetWMNormalHints
(
pScreen
->
myNum
,
width
,
height
);
XResizeWindow
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
width
,
height
);
if
(
doresize
)
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s: resizing DefaultWindow to [%d]x[%d]
\n
"
,
__func__
,
width
,
height
);
#endif
XResizeWindow
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
width
,
height
);
}
if
(
nxagentOption
(
Rootless
)
==
0
)
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s: resizing InputWindow to [%d]x[%d]
\n
"
,
__func__
,
width
,
height
);
#endif
XResizeWindow
(
nxagentDisplay
,
nxagentInputWindows
[
pScreen
->
myNum
],
width
,
height
);
}
}
...
...
@@ -2691,7 +2700,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
AddResource
(
accessWindowID
,
RT_WINDOW
,
(
void
*
)
nxagentShadowWindowPtr
);
nxagentResizeScreen
(
pScreen
,
nxagentShadowWidth
,
nxagentShadowHeight
,
pScreen
->
mmWidth
,
pScreen
->
mmHeight
);
nxagentResizeScreen
(
pScreen
,
nxagentShadowWidth
,
nxagentShadowHeight
,
pScreen
->
mmWidth
,
pScreen
->
mmHeight
,
True
);
nxagentShadowCreateMainWindow
(
pScreen
,
pWin
,
nxagentShadowWidth
,
nxagentShadowHeight
);
...
...
@@ -3646,10 +3655,10 @@ void nxagentAdjustCustomMode(ScreenPtr pScreen)
RRScreenSizeNotify
(
pScreen
);
}
int
nxagentChangeScreenConfig
(
int
screen
,
int
width
,
int
height
)
int
nxagentChangeScreenConfig
(
int
screen
,
int
width
,
int
height
,
Bool
doresize
)
{
#ifdef DEBUG
fprintf
(
stderr
,
"nxagentChangeScreenConfig: called for screen [%d], width [%d] height [%d]
\n
"
,
screen
,
width
,
height
);
fprintf
(
stderr
,
"nxagentChangeScreenConfig: called for screen [%d], width [%d] height [%d]
doresize [%d]
\n
"
,
screen
,
width
,
height
,
doresize
);
#endif
#ifdef TEST
...
...
@@ -3697,7 +3706,7 @@ int nxagentChangeScreenConfig(int screen, int width, int height)
fprintf
(
stderr
,
"nxagentChangeScreenConfig: Changing config to %d x %d
\n
"
,
width
,
height
);
#endif
int
r
=
nxagentResizeScreen
(
pScreen
,
width
,
height
,
0
,
0
);
int
r
=
nxagentResizeScreen
(
pScreen
,
width
,
height
,
0
,
0
,
doresize
);
if
(
r
!=
0
)
{
...
...
nx-X11/programs/Xserver/hw/nxagent/Screen.h
View file @
8deda7bd
...
...
@@ -110,9 +110,9 @@ Window nxagentCreateIconWindow(void);
Bool
nxagentMagicPixelZone
(
int
x
,
int
y
);
Bool
nxagentResizeScreen
(
ScreenPtr
pScreen
,
int
width
,
int
height
,
int
mmWidth
,
int
mmHeight
);
int
mmWidth
,
int
mmHeight
,
Bool
doresize
);
int
nxagentChangeScreenConfig
(
int
screen
,
int
width
,
int
height
);
int
nxagentChangeScreenConfig
(
int
screen
,
int
width
,
int
height
,
Bool
doresize
);
int
nxagentAdjustRandRXinerama
(
ScreenPtr
pScreen
);
...
...
nx-X11/programs/Xserver/hw/nxagent/Window.c
View file @
8deda7bd
...
...
@@ -891,7 +891,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
if
(
nxagentOption
(
Shadow
)
==
0
)
{
nxagentChangeScreenConfig
(
0
,
WidthOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
)),
HeightOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
)));
HeightOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
))
,
True
);
}
else
{
...
...
@@ -945,7 +945,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
if
(
nxagentOption
(
Shadow
)
==
0
)
{
nxagentChangeScreenConfig
(
0
,
nxagentOption
(
RootWidth
),
nxagentOption
(
RootHeight
));
nxagentOption
(
RootHeight
)
,
True
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment