Xnest: move per-screen screensaver window to xnest_screen_info struct
This commit is contained in:
parent
56c646cb63
commit
81b041cae3
|
|
@ -281,9 +281,11 @@ xnestSetScreenSaverColormapWindow(ScreenPtr pScreen)
|
|||
{
|
||||
free(xnestOldInstalledColormapWindows);
|
||||
|
||||
struct xnest_screen_info *screenPriv = xnest_screen_priv(pScreen);
|
||||
|
||||
xnest_wm_colormap_windows(xnestUpstreamInfo.conn,
|
||||
xnest_screen_priv(pScreen)->upstream_frame_window,
|
||||
&xnestScreenSaverWindows[pScreen->myNum],
|
||||
&screenPriv->upstream_saver_window,
|
||||
1);
|
||||
|
||||
xnestOldInstalledColormapWindows = NULL;
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ is" without express or implied warranty.
|
|||
#include "Args.h"
|
||||
#include "mipointrst.h"
|
||||
|
||||
xcb_window_t xnestScreenSaverWindows[MAXSCREENS];
|
||||
DevPrivateKeyRec xnestScreenCursorFuncKeyRec;
|
||||
DevScreenPrivateKeyRec xnestScreenCursorPrivKeyRec;
|
||||
|
||||
|
|
@ -77,33 +76,35 @@ offset(unsigned long mask)
|
|||
static Bool
|
||||
xnestSaveScreen(ScreenPtr pScreen, int what)
|
||||
{
|
||||
struct xnest_screen_info *screenPriv = xnest_screen_priv(pScreen);
|
||||
|
||||
if (xnestSoftwareScreenSaver)
|
||||
return FALSE;
|
||||
else {
|
||||
switch (what) {
|
||||
case SCREEN_SAVER_ON:
|
||||
xcb_map_window(xnestUpstreamInfo.conn, xnestScreenSaverWindows[pScreen->myNum]);
|
||||
xcb_map_window(xnestUpstreamInfo.conn, screenPriv->upstream_saver_window);
|
||||
uint32_t value = XCB_STACK_MODE_ABOVE;
|
||||
xcb_configure_window(xnestUpstreamInfo.conn,
|
||||
xnestScreenSaverWindows[pScreen->myNum],
|
||||
screenPriv->upstream_saver_window,
|
||||
XCB_CONFIG_WINDOW_STACK_MODE,
|
||||
&value);
|
||||
xnestSetScreenSaverColormapWindow(pScreen);
|
||||
break;
|
||||
|
||||
case SCREEN_SAVER_OFF:
|
||||
xcb_unmap_window(xnestUpstreamInfo.conn, xnestScreenSaverWindows[pScreen->myNum]);
|
||||
xcb_unmap_window(xnestUpstreamInfo.conn, screenPriv->upstream_saver_window);
|
||||
xnestSetInstalledColormapWindows(pScreen);
|
||||
break;
|
||||
|
||||
case SCREEN_SAVER_FORCER:
|
||||
lastEventTime = GetTimeInMillis();
|
||||
xcb_unmap_window(xnestUpstreamInfo.conn, xnestScreenSaverWindows[pScreen->myNum]);
|
||||
xcb_unmap_window(xnestUpstreamInfo.conn, screenPriv->upstream_saver_window);
|
||||
xnestSetInstalledColormapWindows(pScreen);
|
||||
break;
|
||||
|
||||
case SCREEN_SAVER_CYCLE:
|
||||
xcb_unmap_window(xnestUpstreamInfo.conn, xnestScreenSaverWindows[pScreen->myNum]);
|
||||
xcb_unmap_window(xnestUpstreamInfo.conn, screenPriv->upstream_saver_window);
|
||||
xnestSetInstalledColormapWindows(pScreen);
|
||||
break;
|
||||
}
|
||||
|
|
@ -495,10 +496,10 @@ breakout:
|
|||
attributes.back_pixmap = xnestScreenSaverPixmap;
|
||||
attributes.colormap = xnestUpstreamInfo.screenInfo->default_colormap;
|
||||
|
||||
xnestScreenSaverWindows[pScreen->myNum] = xcb_generate_id(xnestUpstreamInfo.conn);
|
||||
screenPriv->upstream_saver_window = xcb_generate_id(xnestUpstreamInfo.conn);
|
||||
xcb_aux_create_window(xnestUpstreamInfo.conn,
|
||||
xnestUpstreamInfo.screenInfo->root_depth,
|
||||
xnestScreenSaverWindows[pScreen->myNum],
|
||||
screenPriv->upstream_saver_window,
|
||||
screenPriv->upstream_frame_window,
|
||||
0,
|
||||
0,
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@ is" without express or implied warranty.
|
|||
|
||||
#include <xcb/xcb.h>
|
||||
|
||||
extern xcb_window_t xnestScreenSaverWindows[MAXSCREENS];
|
||||
|
||||
ScreenPtr xnestScreen(xcb_window_t window);
|
||||
Bool xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[]);
|
||||
Bool xnestCloseScreen(ScreenPtr pScreen);
|
||||
|
|
|
|||
|
|
@ -24,6 +24,10 @@ struct xnest_screen_info {
|
|||
several things easier, eg. embedding Xnest into another application, or maybe
|
||||
even adding some control widgets (eg. scroll bars) */
|
||||
xcb_window_t upstream_frame_window;
|
||||
|
||||
/* the SAVER window also is child of the FRAME. It's only mapped while the
|
||||
screen saver is active, and then overlapping our ROOT window. */
|
||||
xcb_window_t upstream_saver_window;
|
||||
};
|
||||
|
||||
struct xnest_upstream_info {
|
||||
|
|
|
|||
Loading…
Reference in New Issue