mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-07-21 14:52:04 +00:00
[client] wayland: fix fullscreen option launch bug
This commit is contained in:
@@ -75,11 +75,7 @@ static void libdecorFrameConfigure(struct libdecor_frame * frame,
|
|||||||
struct libdecor_configuration * configuration, void * opaque)
|
struct libdecor_configuration * configuration, void * opaque)
|
||||||
{
|
{
|
||||||
if (!state.configured)
|
if (!state.configured)
|
||||||
{
|
|
||||||
xdg_surface_ack_configure(libdecor_frame_get_xdg_surface(frame), configuration->serial);
|
xdg_surface_ack_configure(libdecor_frame_get_xdg_surface(frame), configuration->serial);
|
||||||
state.configured = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int width, height;
|
int width, height;
|
||||||
if (libdecor_configuration_get_content_size(configuration, frame, &width, &height))
|
if (libdecor_configuration_get_content_size(configuration, frame, &width, &height))
|
||||||
@@ -96,6 +92,12 @@ static void libdecorFrameConfigure(struct libdecor_frame * frame,
|
|||||||
if (libdecor_configuration_get_window_state(configuration, &windowState))
|
if (libdecor_configuration_get_window_state(configuration, &windowState))
|
||||||
state.fullscreen = windowState & LIBDECOR_WINDOW_STATE_FULLSCREEN;
|
state.fullscreen = windowState & LIBDECOR_WINDOW_STATE_FULLSCREEN;
|
||||||
|
|
||||||
|
if (!state.configured)
|
||||||
|
{
|
||||||
|
state.configured = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
state.resizeSerial = configuration->serial;
|
state.resizeSerial = configuration->serial;
|
||||||
waylandNeedsResize();
|
waylandNeedsResize();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,9 +92,14 @@ static const struct xdg_surface_listener xdgSurfaceListener = {
|
|||||||
|
|
||||||
static void xdgToplevelConfigure(void * data, struct xdg_toplevel * xdgToplevel,
|
static void xdgToplevelConfigure(void * data, struct xdg_toplevel * xdgToplevel,
|
||||||
int32_t width, int32_t height, struct wl_array * states)
|
int32_t width, int32_t height, struct wl_array * states)
|
||||||
|
{
|
||||||
|
// A zero size means that the compositor is leaving the size up to us.
|
||||||
|
if (width > 0 && height > 0)
|
||||||
{
|
{
|
||||||
state.width = width;
|
state.width = width;
|
||||||
state.height = height;
|
state.height = height;
|
||||||
|
}
|
||||||
|
|
||||||
state.fullscreen = false;
|
state.fullscreen = false;
|
||||||
state.floating = true;
|
state.floating = true;
|
||||||
|
|
||||||
|
|||||||
@@ -172,9 +172,16 @@ static bool waylandInit(const LG_DSInitParams params)
|
|||||||
params.borderless, params.resizable))
|
params.borderless, params.resizable))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!waylandEGLInit(params.w, params.h))
|
int width, height;
|
||||||
|
wlWm.desktop->getSize(&width, &height);
|
||||||
|
|
||||||
|
if (!waylandEGLInit(waylandScaleMulInt(wlWm.scale, width),
|
||||||
|
waylandScaleMulInt(wlWm.scale, height)))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
app_handleResizeEvent(width, height, waylandScaleToDouble(wlWm.scale),
|
||||||
|
(struct Border) {0, 0, 0, 0});
|
||||||
|
|
||||||
waylandIconInit();
|
waylandIconInit();
|
||||||
|
|
||||||
#ifdef ENABLE_OPENGL
|
#ifdef ENABLE_OPENGL
|
||||||
|
|||||||
@@ -152,6 +152,18 @@ bool waylandWindowInit(const char * title, const char * appId, bool fullscreen,
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
wl_surface_commit(wlWm.surface);
|
wl_surface_commit(wlWm.surface);
|
||||||
|
|
||||||
|
// The initial configure supplies the compositor-selected size for states
|
||||||
|
// such as fullscreen. It must be received before the first buffer is made.
|
||||||
|
while (!wlWm.desktop->configured())
|
||||||
|
{
|
||||||
|
if (wl_display_roundtrip(wlWm.display) < 0)
|
||||||
|
{
|
||||||
|
DEBUG_ERROR("Failed waiting for the initial Wayland configure");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user