winex11.drv: Introduce is_virtual_desktop().
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8180e338ea
commit
99d047724e
|
@ -77,6 +77,12 @@ static struct screen_size {
|
|||
#define _NET_WM_STATE_REMOVE 0
|
||||
#define _NET_WM_STATE_ADD 1
|
||||
|
||||
/* Return TRUE if Wine is currently in virtual desktop mode */
|
||||
BOOL is_virtual_desktop(void)
|
||||
{
|
||||
return root_window != DefaultRootWindow( gdi_display );
|
||||
}
|
||||
|
||||
/* create the mode structures */
|
||||
static void make_modes(void)
|
||||
{
|
||||
|
@ -268,7 +274,7 @@ static void update_desktop_fullscreen( unsigned int width, unsigned int height)
|
|||
Display *display = thread_display();
|
||||
XEvent xev;
|
||||
|
||||
if (!display || root_window == DefaultRootWindow( display )) return;
|
||||
if (!display || !is_virtual_desktop()) return;
|
||||
|
||||
xev.xclient.type = ClientMessage;
|
||||
xev.xclient.window = root_window;
|
||||
|
|
|
@ -827,7 +827,7 @@ static void focus_out( Display *display , HWND hwnd )
|
|||
x11drv_thread_data()->last_focus = hwnd;
|
||||
if ((xic = X11DRV_get_ic( hwnd ))) XUnsetICFocus( xic );
|
||||
|
||||
if (root_window != DefaultRootWindow(display))
|
||||
if (is_virtual_desktop())
|
||||
{
|
||||
if (hwnd == GetDesktopWindow()) reset_clipping_window();
|
||||
return;
|
||||
|
|
|
@ -572,7 +572,7 @@ BOOL clip_fullscreen_window( HWND hwnd, BOOL reset )
|
|||
{
|
||||
RECT virtual_rect = get_virtual_screen_rect();
|
||||
if (!EqualRect( &rect, &virtual_rect )) return FALSE;
|
||||
if (root_window != DefaultRootWindow( gdi_display )) return FALSE;
|
||||
if (is_virtual_desktop()) return FALSE;
|
||||
}
|
||||
TRACE( "win %p clipping fullscreen\n", hwnd );
|
||||
return grab_clipping_window( &rect );
|
||||
|
|
|
@ -217,7 +217,7 @@ int X11DRV_PALETTE_Init(void)
|
|||
{
|
||||
X11DRV_PALETTE_PaletteFlags |= X11DRV_PALETTE_PRIVATE;
|
||||
|
||||
if( root_window != DefaultRootWindow(gdi_display) )
|
||||
if (is_virtual_desktop())
|
||||
{
|
||||
win_attr.colormap = default_colormap;
|
||||
XChangeWindowAttributes( gdi_display, root_window, CWColormap, &win_attr );
|
||||
|
|
|
@ -587,7 +587,7 @@ static BOOL init_systray(void)
|
|||
WNDCLASSEXW class;
|
||||
Display *display;
|
||||
|
||||
if (root_window != DefaultRootWindow( gdi_display )) return FALSE;
|
||||
if (is_virtual_desktop()) return FALSE;
|
||||
if (init_done) return TRUE;
|
||||
|
||||
icon_cx = GetSystemMetrics( SM_CXSMICON ) + 2 * ICON_BORDER;
|
||||
|
|
|
@ -2474,7 +2474,7 @@ static BOOL hide_icon( struct x11drv_win_data *data )
|
|||
|
||||
if (data->managed) return TRUE;
|
||||
/* hide icons in desktop mode when the taskbar is active */
|
||||
if (root_window == DefaultRootWindow( gdi_display )) return FALSE;
|
||||
if (!is_virtual_desktop()) return FALSE;
|
||||
return IsWindowVisible( FindWindowW( trayW, NULL ));
|
||||
}
|
||||
|
||||
|
@ -2781,7 +2781,7 @@ static BOOL is_netwm_supported( Display *display, Atom atom )
|
|||
*/
|
||||
static LRESULT start_screensaver(void)
|
||||
{
|
||||
if (root_window == DefaultRootWindow(gdi_display))
|
||||
if (!is_virtual_desktop())
|
||||
{
|
||||
const char *argv[3] = { "xdg-screensaver", "activate", NULL };
|
||||
int pid = _spawnvp( _P_DETACH, argv[0], argv );
|
||||
|
|
|
@ -656,6 +656,7 @@ struct x11drv_mode_info
|
|||
|
||||
extern void X11DRV_init_desktop( Window win, unsigned int width, unsigned int height ) DECLSPEC_HIDDEN;
|
||||
extern void X11DRV_resize_desktop(unsigned int width, unsigned int height) DECLSPEC_HIDDEN;
|
||||
extern BOOL is_virtual_desktop(void) DECLSPEC_HIDDEN;
|
||||
extern BOOL is_desktop_fullscreen(void) DECLSPEC_HIDDEN;
|
||||
extern BOOL create_desktop_win_data( Window win ) DECLSPEC_HIDDEN;
|
||||
extern void X11DRV_Settings_AddDepthModes(void) DECLSPEC_HIDDEN;
|
||||
|
|
|
@ -310,10 +310,10 @@ void xinerama_init( unsigned int width, unsigned int height )
|
|||
|
||||
SetRect( &rect, 0, 0, width, height );
|
||||
|
||||
if (root_window != DefaultRootWindow( gdi_display ) || !query_screens())
|
||||
if (is_virtual_desktop() || !query_screens())
|
||||
{
|
||||
default_monitor.rcWork = default_monitor.rcMonitor = rect;
|
||||
if (root_window == DefaultRootWindow( gdi_display ))
|
||||
if (!is_virtual_desktop())
|
||||
query_work_area( &default_monitor.rcWork );
|
||||
else
|
||||
query_desktop_work_area( &default_monitor.rcWork );
|
||||
|
|
|
@ -1099,7 +1099,7 @@ void X11DRV_XRandR_Init(void)
|
|||
|
||||
if (major) return; /* already initialized? */
|
||||
if (!usexrandr) return; /* disabled in config */
|
||||
if (root_window != DefaultRootWindow( gdi_display )) return;
|
||||
if (is_virtual_desktop()) return;
|
||||
if (!(ret = load_xrandr())) return; /* can't load the Xrandr library */
|
||||
|
||||
/* see if Xrandr is available */
|
||||
|
|
|
@ -210,7 +210,7 @@ void X11DRV_XF86VM_Init(void)
|
|||
#endif /* X_XF86VidModeSetGammaRamp */
|
||||
|
||||
/* retrieve modes */
|
||||
if (usexvidmode && root_window == DefaultRootWindow( gdi_display ))
|
||||
if (usexvidmode && !is_virtual_desktop())
|
||||
{
|
||||
X11DRV_expect_error(gdi_display, XVidModeErrorHandler, NULL);
|
||||
ok = pXF86VidModeGetAllModeLines(gdi_display, DefaultScreen(gdi_display), &nmodes, &real_xf86vm_modes);
|
||||
|
|
Loading…
Reference in New Issue