diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2022-11-02 07:46:19 +0200 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2022-12-15 22:23:08 +0200 |
commit | 026d18b3800501e7825b4e29cb0b7214fc9d19c2 (patch) | |
tree | beab6b7268e7c755c8a087dfaba65131a5023449 /src/egl | |
parent | caac7be425a185e191224833375413772c4aff8d (diff) | |
download | mesa-demos-026d18b3800501e7825b4e29cb0b7214fc9d19c2.tar.gz |
xeglgears: Use NET_WM_STATE_FULLSCREEN
Use NET_WM_STATE to make the window proper fullscreen.
Acked-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'src/egl')
-rw-r--r-- | src/egl/opengl/xeglgears.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/egl/opengl/xeglgears.c b/src/egl/opengl/xeglgears.c index b4206674..201f2da5 100644 --- a/src/egl/opengl/xeglgears.c +++ b/src/egl/opengl/xeglgears.c @@ -39,6 +39,7 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> +#include <X11/Xatom.h> #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/keysym.h> @@ -423,6 +424,21 @@ egl_manager_new(EGLNativeDisplayType xdpy, const EGLint *attrib_list, return eman; } +static void +make_fullscreen(Display *dpy, Window w) +{ + Atom NET_WM_STATE, NET_WM_STATE_FULLSCREEN; + + NET_WM_STATE = XInternAtom(dpy, "_NET_WM_STATE", False); + NET_WM_STATE_FULLSCREEN = XInternAtom(dpy, "_NET_WM_STATE_FULLSCREEN", False); + if (NET_WM_STATE == None || NET_WM_STATE_FULLSCREEN == None) + return; + + XChangeProperty(dpy, w, NET_WM_STATE, + XA_ATOM, 32, PropModeReplace, + (unsigned char *)&NET_WM_STATE_FULLSCREEN, 1); +} + static EGLBoolean egl_manager_create_window(struct egl_manager *eman, const char *name, EGLint w, EGLint h, EGLBoolean need_surface, @@ -491,6 +507,9 @@ egl_manager_create_window(struct egl_manager *eman, const char *name, None, (char **)NULL, 0, &sizehints); } + if (fullscreen) + make_fullscreen(eman->xdpy, eman->xwin); + if (need_surface) { eman->win = eglCreateWindowSurface(eman->dpy, eman->conf, eman->xwin, attrib_list); |