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
c0f67abb
Unverified
Commit
c0f67abb
authored
May 24, 2018
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'uli42-pr/cleanup_window_hints' into 3.6.x
Attributes GH PR #689:
https://github.com/ArcticaProject/nx-libs/pull/689
parents
985bed95
9138a9e3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
63 additions
and
46 deletions
+63
-46
Events.c
nx-X11/programs/Xserver/hw/nxagent/Events.c
+52
-36
Events.h
nx-X11/programs/Xserver/hw/nxagent/Events.h
+1
-1
Extensions.c
nx-X11/programs/Xserver/hw/nxagent/Extensions.c
+1
-1
Reconnect.c
nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
+1
-1
Screen.c
nx-X11/programs/Xserver/hw/nxagent/Screen.c
+0
-0
Screen.h
nx-X11/programs/Xserver/hw/nxagent/Screen.h
+5
-3
Window.c
nx-X11/programs/Xserver/hw/nxagent/Window.c
+3
-4
No files found.
nx-X11/programs/Xserver/hw/nxagent/Events.c
View file @
c0f67abb
...
...
@@ -575,8 +575,6 @@ void nxagentInternalWindowsTree(WindowPtr pWin, int indent)
void
nxagentSwitchResizeMode
(
ScreenPtr
pScreen
)
{
XSizeHints
sizeHints
;
#ifdef DEBUG
fprintf
(
stderr
,
"nxagentSwitchResizeMode called.
\n
"
);
#endif
...
...
@@ -585,8 +583,6 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen)
nxagentChangeOption
(
DesktopResize
,
!
desktopResize
);
sizeHints
.
flags
=
PMaxSize
;
if
(
nxagentOption
(
DesktopResize
)
==
0
)
{
fprintf
(
stderr
,
"Info: Disabled desktop resize mode in agent.
\n
"
);
...
...
@@ -595,11 +591,9 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen)
if
(
nxagentOption
(
Fullscreen
)
==
0
)
{
sizeHints
.
max_width
=
nxagentOption
(
RootWidth
);
sizeHints
.
max_height
=
nxagentOption
(
RootHeight
);
XSetWMNormalHints
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
&
sizeHints
);
nxagentSetWMNormalHintsMaxsize
(
pScreen
,
nxagentOption
(
RootWidth
),
nxagentOption
(
RootHeight
));
}
}
else
...
...
@@ -608,32 +602,25 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen)
nxagentLaunchDialog
(
DIALOG_ENABLE_DESKTOP_RESIZE_MODE
);
nxagentChangeScreenConfig
(
0
,
nxagentOption
(
Width
),
nxagentOption
(
Height
),
0
,
0
);
nxagentChangeScreenConfig
(
0
,
nxagentOption
(
Width
),
nxagentOption
(
Height
));
if
(
nxagentOption
(
ClientOs
)
==
ClientOsWinnt
)
{
NXSetExposeParameters
(
nxagentDisplay
,
0
,
0
,
0
);
}
sizeHints
.
max_width
=
WidthOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
));
sizeHints
.
max_height
=
HeightOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
));
XSetWMNormalHints
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
&
sizeHints
);
nxagentSetWMNormalHintsMaxsize
(
pScreen
,
WidthOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
)),
HeightOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
)));
}
}
void
nxagentShadowSwitchResizeMode
(
ScreenPtr
pScreen
)
{
XSizeHints
sizeHints
;
int
desktopResize
=
nxagentOption
(
DesktopResize
);
nxagentChangeOption
(
DesktopResize
,
!
desktopResize
);
sizeHints
.
flags
=
PMaxSize
;
if
(
nxagentOption
(
DesktopResize
)
==
0
)
{
nxagentShadowSetRatio
(
1
.
0
,
1
.
0
);
...
...
@@ -641,8 +628,9 @@ void nxagentShadowSwitchResizeMode(ScreenPtr pScreen)
nxagentShadowCreateMainWindow
(
screenInfo
.
screens
[
DefaultScreen
(
nxagentDisplay
)],
screenInfo
.
screens
[
0
]
->
root
,
screenInfo
.
screens
[
0
]
->
root
->
drawable
.
width
,
screenInfo
.
screens
[
0
]
->
root
->
drawable
.
height
);
sizeHints
.
max_width
=
nxagentOption
(
RootWidth
);
sizeHints
.
max_height
=
nxagentOption
(
RootHeight
);
nxagentSetWMNormalHintsMaxsize
(
pScreen
,
nxagentOption
(
RootWidth
),
nxagentOption
(
RootHeight
));
fprintf
(
stderr
,
"Info: Disabled resize mode in shadow agent.
\n
"
);
}
...
...
@@ -657,14 +645,12 @@ void nxagentShadowSwitchResizeMode(ScreenPtr pScreen)
screenInfo
.
screens
[
0
]
->
root
,
screenInfo
.
screens
[
0
]
->
root
->
drawable
.
width
,
screenInfo
.
screens
[
0
]
->
root
->
drawable
.
height
);
sizeHints
.
max_width
=
WidthOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
));
sizeHints
.
max_height
=
HeightOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
));
nxagentSetWMNormalHintsMaxsize
(
pScreen
,
WidthOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
)),
HeightOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
)));
fprintf
(
stderr
,
"Info: Enabled resize mode in shadow agent.
\n
"
);
}
XSetWMNormalHints
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
&
sizeHints
);
}
static
void
nxagentSwitchDeferMode
(
void
)
...
...
@@ -3248,6 +3234,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
pClient
=
wClient
(
pWinWindow
);
/* FIXME: override_redirect is always FALSE here */
if
(
X
->
xconfigure
.
send_event
||
!
nxagentWMIsRunning
||
X
->
xconfigure
.
override_redirect
)
{
...
...
@@ -3354,13 +3341,26 @@ int nxagentHandleConfigureNotify(XEvent* X)
{
if
(
nxagentOption
(
AllScreens
)
==
0
)
{
/*
* - WITHOUT window manager any position change is relevant
* - WITH window manager only synthetic position changes send
* by the window manager are relevant, see ICCCM Chapter 4,
* "Configuring the Window"
*/
Bool
updatePos
=
(
nxagentWMIsRunning
==
0
||
X
->
xconfigure
.
send_event
!=
0
);
int
newX
=
X
->
xconfigure
.
x
;
int
newY
=
X
->
xconfigure
.
y
;
if
(
nxagentOption
(
DesktopResize
)
==
1
)
{
if
(
nxagentOption
(
Width
)
!=
X
->
xconfigure
.
width
||
nxagentOption
(
Height
)
!=
X
->
xconfigure
.
height
||
nxagentOption
(
X
)
!=
X
->
xconfigure
.
x
||
nxagentOption
(
Y
)
!=
X
->
xconfigure
.
y
)
(
updatePos
&&
(
nxagentOption
(
X
)
!=
newX
||
nxagentOption
(
Y
)
!=
newY
))
)
{
#ifdef DEBUG
int
count
=
0
;
#endif
Bool
newEvents
=
False
;
doRandR
=
True
;
...
...
@@ -3377,8 +3377,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
nxagentWaitEvents
(
nxagentDisplay
,
&
timeout
);
/*
* This should also flush
* the NX link for us.
* This should also flush the NX link for us.
*/
XSync
(
nxagentDisplay
,
0
);
...
...
@@ -3386,17 +3385,34 @@ int nxagentHandleConfigureNotify(XEvent* X)
while
(
XCheckTypedWindowEvent
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
ConfigureNotify
,
X
))
{
#ifdef DEBUG
count
++
;
#endif
if
(
nxagentWMIsRunning
==
0
||
X
->
xconfigure
.
send_event
)
{
updatePos
=
True
;
newX
=
X
->
xconfigure
.
x
;
newY
=
X
->
xconfigure
.
y
;
}
newEvents
=
True
;
}
}
while
(
newEvents
);
#ifdef DEBUG
fprintf
(
stderr
,
"%s: accumulated %d events
\n
"
,
__func__
,
count
);
#endif
}
}
if
(
nxagentWMIsRunning
==
0
||
X
->
xconfigure
.
send_event
)
if
(
updatePos
)
{
nxagentChangeOption
(
X
,
X
->
xconfigure
.
x
);
nxagentChangeOption
(
Y
,
X
->
xconfigure
.
y
);
#ifdef DEBUG
fprintf
(
stderr
,
"%s: Updating nxagent window position [%d,%d]
\n
"
,
__func__
,
newX
,
newY
);
#endif
nxagentChangeOption
(
X
,
newX
);
nxagentChangeOption
(
Y
,
newY
);
}
if
(
nxagentOption
(
Shadow
)
==
1
&&
nxagentOption
(
DesktopResize
)
==
1
&&
...
...
@@ -3464,7 +3480,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
#endif
nxagentChangeScreenConfig
(
0
,
nxagentOption
(
Width
),
nxagentOption
(
Height
)
,
0
,
0
);
nxagentOption
(
Height
));
}
}
...
...
@@ -3484,7 +3500,7 @@ int nxagentHandleConfigureNotify(XEvent* X)
nxagentChangeOption
(
RootHeight
,
X
->
xconfigure
.
height
);
nxagentChangeScreenConfig
(
0
,
nxagentOption
(
Width
),
nxagentOption
(
Height
)
,
0
,
0
);
nxagentOption
(
Height
));
return
1
;
}
...
...
nx-X11/programs/Xserver/hw/nxagent/Events.h
View file @
c0f67abb
...
...
@@ -231,7 +231,7 @@ Bool nxagentPendingEvents(Display *dpy);
XEventsQueued((display), QueuedAfterReading)
#define nxagentCheckEvents(display, event, predicate, argument) \
XCheckIfEventNoFlush((display), (event), (predicate), (argument))
XCheckIfEventNoFlush((display), (event), (predicate), (argument))
int
nxagentWaitEvents
(
Display
*
,
struct
timeval
*
);
...
...
nx-X11/programs/Xserver/hw/nxagent/Extensions.c
View file @
c0f67abb
...
...
@@ -470,7 +470,7 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
nxagentOption
(
Fullscreen
)
==
0
&&
nxagentOption
(
AllScreens
)
==
0
)
{
nxagentRandRSetWindowsSize
(
width
,
height
);
nxagentSetWMNormalHints
(
pScreen
->
myNum
);
nxagentSetWMNormalHints
(
pScreen
->
myNum
,
nxagentOption
(
Width
),
nxagentOption
(
Height
)
);
}
nxagentMoveViewport
(
pScreen
,
0
,
0
);
...
...
nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
View file @
c0f67abb
...
...
@@ -626,7 +626,7 @@ Bool nxagentReconnectSession(void)
if
(
nxagentResizeDesktopAtStartup
||
nxagentOption
(
Rootless
)
==
True
||
nxagentOption
(
Xinerama
)
==
True
)
{
nxagentChangeScreenConfig
(
0
,
nxagentOption
(
RootWidth
),
nxagentOption
(
RootHeight
)
,
0
,
0
);
nxagentOption
(
RootHeight
));
nxagentResizeDesktopAtStartup
=
False
;
}
...
...
nx-X11/programs/Xserver/hw/nxagent/Screen.c
View file @
c0f67abb
This diff is collapsed.
Click to expand it.
nx-X11/programs/Xserver/hw/nxagent/Screen.h
View file @
c0f67abb
...
...
@@ -48,7 +48,7 @@ is" without express or implied warranty.
#define nxagentSetPrintGeometry(screen) \
nxagentPrintGeometryFlags = (1 << (screen));
extern
int
nxagentClients
;
extern
int
nxagentAutoDisconnectTimeout
;
...
...
@@ -110,7 +110,7 @@ Bool nxagentMagicPixelZone(int x, int y);
Bool
nxagentResizeScreen
(
ScreenPtr
pScreen
,
int
width
,
int
height
,
int
mmWidth
,
int
mmHeight
);
int
nxagentChangeScreenConfig
(
int
screen
,
int
width
,
int
height
,
int
mmWidth
,
int
mmHeight
);
int
nxagentChangeScreenConfig
(
int
screen
,
int
width
,
int
height
);
int
nxagentAdjustRandRXinerama
(
ScreenPtr
pScreen
);
...
...
@@ -130,7 +130,9 @@ int nxagentShadowPoll(PixmapPtr, GCPtr, unsigned char, int, int, char *, int *,
void
nxagentShadowSetWindowsSize
(
void
);
void
nxagentSetWMNormalHints
(
int
);
void
nxagentSetWMNormalHints
(
int
,
int
,
int
);
void
nxagentSetWMNormalHintsMaxsize
(
ScreenPtr
,
int
,
int
);
void
nxagentShadowSetRatio
(
float
,
float
);
...
...
nx-X11/programs/Xserver/hw/nxagent/Window.c
View file @
c0f67abb
...
...
@@ -869,8 +869,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
}
/*
* This should also flush
* the NX link for us.
* This should also flush the NX link for us.
*/
XSync
(
nxagentDisplay
,
0
);
...
...
@@ -953,7 +952,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
if
(
nxagentOption
(
Shadow
)
==
0
)
{
nxagentChangeScreenConfig
(
0
,
WidthOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
)),
HeightOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
))
,
0
,
0
);
HeightOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
)));
}
else
{
...
...
@@ -1007,7 +1006,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
if
(
nxagentOption
(
Shadow
)
==
0
)
{
nxagentChangeScreenConfig
(
0
,
nxagentOption
(
RootWidth
),
nxagentOption
(
RootHeight
)
,
0
,
0
);
nxagentOption
(
RootHeight
));
}
}
...
...
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