From ea825e17592239406ba7d9c312b9fff37464bdb4 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Tue, 26 May 2009 12:54:54 -0500 Subject: [PATCH] winex11.drv: set the fullscreen state of virtual desktops based on size --- dlls/winex11.drv/desktop.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 41 insertions(+), 0 deletions(-) diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index d6b2888..685e15a 100644 --- a/dlls/winex11.drv/desktop.c +++ b/dlls/winex11.drv/desktop.c @@ -42,6 +42,9 @@ static const unsigned int widths[] = {320, 400, 512, 640, 800, 1024, 1152, 1280 static const unsigned int heights[] = {200, 300, 384, 480, 600, 768, 864, 1024, 1050, 1200}; #define NUM_DESKTOP_MODES (sizeof(widths) / sizeof(widths[0])) +#define _NET_WM_STATE_REMOVE 0 +#define _NET_WM_STATE_ADD 1 + /* create the mode structures */ static void make_modes(void) { @@ -151,6 +154,14 @@ Window CDECL X11DRV_create_desktop( UINT width, UINT height ) 0, 0, width, height, 0, screen_depth, InputOutput, visual, CWEventMask | CWCursor | CWColormap, &win_attr ); XFlush( display ); + + if (width == screen_width && height == screen_height) + { + TRACE("setting desktop to fullscreen\n"); + XChangeProperty( display, win, x11drv_atom(_NET_WM_STATE), XA_ATOM, 32, + PropModeReplace, (unsigned char*)&x11drv_atom(_NET_WM_STATE_FULLSCREEN), + 1); + } wine_tsx11_unlock(); if (win != None) X11DRV_init_desktop( win, width, height ); return win; @@ -191,6 +202,35 @@ static BOOL CALLBACK update_windows_on_desktop_resize( HWND hwnd, LPARAM lparam return TRUE; } +static void update_desktop_fullscreen( unsigned int width, unsigned int height) +{ + Display *display = thread_display(); + XEvent xev; + + wine_tsx11_lock(); + + xev.xclient.type = ClientMessage; + xev.xclient.window = root_window; + xev.xclient.message_type = x11drv_atom(_NET_WM_STATE); + xev.xclient.serial = 0; + xev.xclient.display = display; + xev.xclient.send_event = True; + xev.xclient.format = 32; + if (width == max_width && height == max_height) + xev.xclient.data.l[0] = _NET_WM_STATE_ADD; + else + xev.xclient.data.l[0] = _NET_WM_STATE_REMOVE; + xev.xclient.data.l[1] = x11drv_atom(_NET_WM_STATE_FULLSCREEN); + xev.xclient.data.l[2] = 0; + xev.xclient.data.l[3] = 1; + + TRACE("action=%i\n", xev.xclient.data.l[0]); + + XSendEvent( display, DefaultRootWindow(display), False, + SubstructureRedirectMask | SubstructureNotifyMask, &xev ); + + wine_tsx11_unlock(); +} /*********************************************************************** * X11DRV_resize_desktop @@ -212,6 +252,7 @@ void X11DRV_resize_desktop( unsigned int width, unsigned int height ) else { TRACE( "desktop %p change to (%dx%d)\n", hwnd, width, height ); + update_desktop_fullscreen( width, height ); SetWindowPos( hwnd, 0, virtual_screen_rect.left, virtual_screen_rect.top, virtual_screen_rect.right - virtual_screen_rect.left, virtual_screen_rect.bottom - virtual_screen_rect.top, -- 1.5.4.3