[client] x11: set window posision before entering fullscreen

This fixes an issue where the window position would be ignored if the
application was launched in full screen mode from the command line
causing the client to enter full screen on the wrong monitor in
multi-monitor configurations.
This commit is contained in:
Geoffrey McRae 2022-05-15 20:41:06 +10:00
parent 76d2c69b46
commit d7704b13c0

View File

@ -398,23 +398,14 @@ static bool x11Init(const LG_DSInitParams params)
); );
} }
Atom wmState[3] = {0};
int wmStateCount = 0;
if (params.fullscreen)
{
x11.fullscreen = true;
wmState[wmStateCount++] = x11atoms._NET_WM_STATE_FULLSCREEN;
}
if (params.maximize) if (params.maximize)
{ {
wmState[wmStateCount++] = x11atoms._NET_WM_STATE_MAXIMIZED_HORZ; Atom wmState[2] =
wmState[wmStateCount++] = x11atoms._NET_WM_STATE_MAXIMIZED_VERT; {
} x11atoms._NET_WM_STATE_MAXIMIZED_HORZ,
x11atoms._NET_WM_STATE_MAXIMIZED_VERT
};
if (wmStateCount)
{
XChangeProperty( XChangeProperty(
x11.display, x11.display,
x11.window, x11.window,
@ -423,7 +414,7 @@ static bool x11Init(const LG_DSInitParams params)
32, 32,
PropModeReplace, PropModeReplace,
(unsigned char *)&wmState, (unsigned char *)&wmState,
wmStateCount 2
); );
} }
@ -664,6 +655,9 @@ static bool x11Init(const LG_DSInitParams params)
if (!params.center) if (!params.center)
XMoveWindow(x11.display, x11.window, params.x, params.y); XMoveWindow(x11.display, x11.window, params.x, params.y);
if (params.fullscreen)
x11SetFullscreen(true);
XSetLocaleModifiers(""); // Load XMODIFIERS XSetLocaleModifiers(""); // Load XMODIFIERS
x11.xim = XOpenIM(x11.display, 0, 0, 0); x11.xim = XOpenIM(x11.display, 0, 0, 0);