winex11.drv: Add support for _NET_WORKAREA.
This commit is contained in:
parent
1e344db7a6
commit
9aaa24091f
|
@ -614,6 +614,7 @@ enum x11drv_atoms
|
|||
XATOM__NET_WM_WINDOW_TYPE_DIALOG,
|
||||
XATOM__NET_WM_WINDOW_TYPE_NORMAL,
|
||||
XATOM__NET_WM_WINDOW_TYPE_UTILITY,
|
||||
XATOM__NET_WORKAREA,
|
||||
XATOM__XEMBED_INFO,
|
||||
XATOM_XdndAware,
|
||||
XATOM_XdndEnter,
|
||||
|
|
|
@ -150,6 +150,7 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] =
|
|||
"_NET_WM_WINDOW_TYPE_DIALOG",
|
||||
"_NET_WM_WINDOW_TYPE_NORMAL",
|
||||
"_NET_WM_WINDOW_TYPE_UTILITY",
|
||||
"_NET_WORKAREA",
|
||||
"_XEMBED_INFO",
|
||||
"XdndAware",
|
||||
"XdndEnter",
|
||||
|
|
|
@ -65,6 +65,25 @@ static inline int monitor_to_index( HMONITOR handle )
|
|||
return index - 1;
|
||||
}
|
||||
|
||||
static void query_work_area( RECT *rc_work )
|
||||
{
|
||||
Atom type;
|
||||
int format;
|
||||
unsigned long count, remaining;
|
||||
long *work_area;
|
||||
|
||||
if (!XGetWindowProperty( gdi_display, DefaultRootWindow(gdi_display), x11drv_atom(_NET_WORKAREA), 0,
|
||||
~0, False, XA_CARDINAL, &type, &format, &count,
|
||||
&remaining, (unsigned char **)&work_area ))
|
||||
{
|
||||
if (type == XA_CARDINAL && format == 32 && count >= 4)
|
||||
{
|
||||
SetRect( rc_work, work_area[0], work_area[1],
|
||||
work_area[0] + work_area[2], work_area[1] + work_area[3] );
|
||||
}
|
||||
XFree( work_area );
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef SONAME_LIBXINERAMA
|
||||
|
||||
|
@ -92,10 +111,13 @@ static int query_screens(void)
|
|||
{
|
||||
int i, count, event_base, error_base;
|
||||
XineramaScreenInfo *screens;
|
||||
RECT rc_work;
|
||||
|
||||
if (!monitors) /* first time around */
|
||||
load_xinerama();
|
||||
|
||||
query_work_area( &rc_work );
|
||||
|
||||
if (!pXineramaQueryExtension || !pXineramaQueryScreens ||
|
||||
!pXineramaQueryExtension( gdi_display, &event_base, &error_base ) ||
|
||||
!(screens = pXineramaQueryScreens( gdi_display, &count ))) return 0;
|
||||
|
@ -111,8 +133,9 @@ static int query_screens(void)
|
|||
monitors[i].rcMonitor.top = screens[i].y_org;
|
||||
monitors[i].rcMonitor.right = screens[i].x_org + screens[i].width;
|
||||
monitors[i].rcMonitor.bottom = screens[i].y_org + screens[i].height;
|
||||
monitors[i].rcWork = monitors[i].rcMonitor;
|
||||
monitors[i].dwFlags = 0;
|
||||
if (!IntersectRect( &monitors[i].rcWork, &rc_work, &monitors[i].rcMonitor ))
|
||||
monitors[i].rcWork = monitors[i].rcMonitor;
|
||||
/* FIXME: using the same device name for all monitors for now */
|
||||
lstrcpyW( monitors[i].szDevice, default_monitor.szDevice );
|
||||
}
|
||||
|
@ -147,6 +170,8 @@ void xinerama_init( unsigned int width, unsigned int height )
|
|||
if (root_window != DefaultRootWindow( gdi_display ) || !query_screens())
|
||||
{
|
||||
default_monitor.rcWork = default_monitor.rcMonitor = rect;
|
||||
if (root_window == DefaultRootWindow( gdi_display ))
|
||||
query_work_area( &default_monitor.rcWork );
|
||||
nb_monitors = 1;
|
||||
monitors = &default_monitor;
|
||||
}
|
||||
|
@ -159,8 +184,9 @@ void xinerama_init( unsigned int width, unsigned int height )
|
|||
{
|
||||
OffsetRect( &monitors[i].rcMonitor, rect.left, rect.top );
|
||||
OffsetRect( &monitors[i].rcWork, rect.left, rect.top );
|
||||
TRACE( "monitor %p: %s%s\n",
|
||||
TRACE( "monitor %p: %s work %s%s\n",
|
||||
index_to_monitor(i), wine_dbgstr_rect(&monitors[i].rcMonitor),
|
||||
wine_dbgstr_rect(&monitors[i].rcWork),
|
||||
(monitors[i].dwFlags & MONITORINFOF_PRIMARY) ? " (primary)" : "" );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue