GNOME Bugzilla – Bug 427902
unclear how to make fullscreen non-resizable window
Last modified: 2007-04-09 18:03:56 UTC
Please describe the problem: I need to make non-resizable fullscreen window, to do this I set min/max/normal size to size of screen (as xdpyinfo reports them). But the window doesn't have _NET_WM_ACTION_FULLSCREEN in _NET_WM_ALLOWED_ACTIONS :( But it actually allows user to make the window a fullscreen window (according to _NET_WM_STATE) Another problem is that for Xinerama, metacity uses size of whole xinarem's screen, to compare with window's min size, but fullscreen window is resized to size of one monitor. Steps to reproduce: compile and ran the following program. If you pass 0 as parameter it will set max/normal. but not min size and the window will have _NET_WM_ACTION_FULLSCREEN. When you pass 1 as param for the program it sets all normal/max/min sizes and the window doesn't have _NET_WM_ACTION_FULLSCREEN. (NOTE: the program uses hard-coded width and heigh, so you need to change them to real size of your monitor) #include <X11/Xatom.h> #include <X11/Xlib.h> #include <X11/Xos.h> #include <X11/Xutil.h> #include <Xm/MwmUtil.h> #include <stdio.h> #include <string.h> // Atom XA_ATOM; Atom XA_NET_WM_STATE; Atom XA_NET_WM_STATE_NORMAL; Atom XA_NET_WM_STATE_FULLSCREEN; Atom XA_MOTIF_WM_HINTS; Display *display; Window root, w1, w2, w3, w4; Window create_window(char *name, Window parent, int x, int y, int width, int height, int setMinSize) { Window win = XCreateSimpleWindow(display, parent, x, y, width, height, 2, BlackPixel(display, 0), WhitePixel(display, 0)); XStoreName(display, win, name); XSizeHints *hints = XAllocSizeHints(); hints->width = width; hints->height = height; hints->max_width = width; hints->max_height = height; hints->x = x; hints->y = y; hints->flags = USPosition | USSize | PMaxSize; if (setMinSize) { hints->min_width = width; hints->min_height = height; hints->flags = hints->flags | PMinSize; } XSetWMNormalHints(display, win, hints); XFree(hints); return win; } void set_mwm_hints(Window w) { XA_MOTIF_WM_HINTS = XInternAtom(display, "_MOTIF_WM_HINTS", False); PropMotifWmHints hints; hints.flags = MWM_HINTS_DECORATIONS | MWM_HINTS_FUNCTIONS; hints.decorations = 0; hints.functions = MWM_FUNC_RESIZE | MWM_FUNC_MOVE; hints.inputMode = 0; hints.status = 0; XChangeProperty(display, w, XA_MOTIF_WM_HINTS, XA_MOTIF_WM_HINTS, 32, PropModeReplace, (unsigned char *)&hints, 5); } int main(int argc, char **argv) { XEvent ev; char *display_name = NULL; if ((display = XOpenDisplay(display_name)) == NULL) { fprintf(stderr, "Couldn't open %s\n", XDisplayName(display_name)); return -1; } root = RootWindow(display, 0); w1 = create_window("Window", root, 0, 0, 1400, 1050, argv[1][0] - '0'); set_mwm_hints(w1); XMapWindow(display, w1); XFlush(display); /* XMoveResizeWindow(display, w1, 0, 0, 1280, 1024); */ /* XFlush(display); */ while (1) { XNextEvent(display, &ev); } return 0; } Actual results: non-resizable window which size is equal to size of screen (according to xdpyinfo) can not be made a fullscreen window. Expected results: there should be a way to make fullscreen non-resizable window Does this happen every time? reproducible always Other information:
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of 116343 ***