aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/miext
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-10-19 20:43:37 +0000
committermarha <marha@users.sourceforge.net>2009-10-19 20:43:37 +0000
commit9dbe22229a8031aa2f6d922896e1b6539441b7b5 (patch)
treebd567f1d98f9431b4963dc3d0b05aea8ac78a1b6 /xorg-server/miext
parent07d4e6e86e3167bed18d2af81a56f3d9352d2541 (diff)
parent7687adcc34c9fc43d526f30b1cf2039b0af48841 (diff)
downloadvcxsrv-9dbe22229a8031aa2f6d922896e1b6539441b7b5.tar.gz
vcxsrv-9dbe22229a8031aa2f6d922896e1b6539441b7b5.tar.bz2
vcxsrv-9dbe22229a8031aa2f6d922896e1b6539441b7b5.zip
svn merge ^/branches/released
Diffstat (limited to 'xorg-server/miext')
-rw-r--r--xorg-server/miext/rootless/rootless.h9
-rw-r--r--xorg-server/miext/rootless/rootlessCommon.h4
-rw-r--r--xorg-server/miext/rootless/rootlessScreen.c4
-rw-r--r--xorg-server/miext/rootless/rootlessWindow.c76
-rw-r--r--xorg-server/miext/rootless/rootlessWindow.h2
5 files changed, 26 insertions, 69 deletions
diff --git a/xorg-server/miext/rootless/rootless.h b/xorg-server/miext/rootless/rootless.h
index bde4cff52..00eac4e8a 100644
--- a/xorg-server/miext/rootless/rootless.h
+++ b/xorg-server/miext/rootless/rootless.h
@@ -351,6 +351,13 @@ typedef void (*RootlessCopyWindowProc)
(RootlessFrameID wid, int dstNrects, const BoxRec *dstRects,
int dx, int dy);
+
+typedef void (*RootlessHideWindowProc)
+ (RootlessFrameID wid);
+
+typedef void (*RootlessUpdateColormapProc)
+ (RootlessFrameID wid, ScreenPtr pScreen);
+
/*
* Rootless implementation function list
*/
@@ -374,6 +381,8 @@ typedef struct _RootlessFrameProcs {
/* Optional frame functions */
RootlessSwitchWindowProc SwitchWindow;
RootlessDoReorderWindowProc DoReorderWindow;
+ RootlessHideWindowProc HideWindow;
+ RootlessUpdateColormapProc UpdateColormap;
/* Optional acceleration functions */
RootlessCopyBytesProc CopyBytes;
diff --git a/xorg-server/miext/rootless/rootlessCommon.h b/xorg-server/miext/rootless/rootlessCommon.h
index ba121c0f4..d4a94f8ca 100644
--- a/xorg-server/miext/rootless/rootlessCommon.h
+++ b/xorg-server/miext/rootless/rootlessCommon.h
@@ -268,9 +268,6 @@ Bool RootlessResolveColormap (ScreenPtr pScreen, int first_color,
void RootlessFlushWindowColormap (WindowPtr pWin);
void RootlessFlushScreenColormaps (ScreenPtr pScreen);
-// xp_error
-int RootlessColormapCallback(void *data, int first_color, int n_colors, uint32_t *colors);
-
// Move a window to its proper location on the screen.
void RootlessRepositionWindow(WindowPtr pWin);
@@ -285,5 +282,6 @@ void RootlessUpdateRooted (Bool state);
void RootlessEnableRoot (ScreenPtr pScreen);
void RootlessDisableRoot (ScreenPtr pScreen);
+void RootlessSetPixmapOfAncestors(WindowPtr pWin);
#endif /* _ROOTLESSCOMMON_H */
diff --git a/xorg-server/miext/rootless/rootlessScreen.c b/xorg-server/miext/rootless/rootlessScreen.c
index b10ca70eb..c73d5170b 100644
--- a/xorg-server/miext/rootless/rootlessScreen.c
+++ b/xorg-server/miext/rootless/rootlessScreen.c
@@ -257,7 +257,7 @@ RootlessComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
maskWin = (pMask->pDrawable->type == DRAWABLE_WINDOW) ?
(WindowPtr)pMask->pDrawable : NULL;
}
- srcWin = (pSrc->pDrawable->type == DRAWABLE_WINDOW) ?
+ srcWin = (pSrc->pDrawable && pSrc->pDrawable->type == DRAWABLE_WINDOW) ?
(WindowPtr)pSrc->pDrawable : NULL;
dstWin = (pDst->pDrawable->type == DRAWABLE_WINDOW) ?
(WindowPtr)pDst->pDrawable : NULL;
@@ -297,7 +297,7 @@ RootlessGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
GlyphPtr glyph;
WindowPtr srcWin, dstWin;
- srcWin = (pSrc->pDrawable->type == DRAWABLE_WINDOW) ?
+ srcWin = (pSrc->pDrawable && pSrc->pDrawable->type == DRAWABLE_WINDOW) ?
(WindowPtr)pSrc->pDrawable : NULL;
dstWin = (pDst->pDrawable->type == DRAWABLE_WINDOW) ?
(WindowPtr)pDst->pDrawable : NULL;
diff --git a/xorg-server/miext/rootless/rootlessWindow.c b/xorg-server/miext/rootless/rootlessWindow.c
index 1b8c6cbf2..53028b5c1 100644
--- a/xorg-server/miext/rootless/rootlessWindow.c
+++ b/xorg-server/miext/rootless/rootlessWindow.c
@@ -36,15 +36,15 @@
#include <stddef.h> /* For NULL */
#include <limits.h> /* For CHAR_BIT */
#include <assert.h>
-#ifdef __APPLE__
-//#include <X11/Xlib.h>
#include <X11/Xatom.h>
+#ifdef __APPLE__
+#include <Xplugin.h>
#include "mi.h"
#include "pixmapstr.h"
#include "windowstr.h"
-#include <Xplugin.h>
//#include <X11/extensions/applewm.h>
extern int darwinMainScreenX, darwinMainScreenY;
+extern Bool no_configure_window;
#endif
#include "fb.h"
@@ -67,8 +67,6 @@ extern int darwinMainScreenX, darwinMainScreenY;
#define SCREEN_TO_GLOBAL_Y 0
#endif
-#define MAKE_WINDOW_ID(x) ((xp_window_id)((size_t)(x)))
-
#define DEFINE_ATOM_HELPER(func,atom_name) \
static Atom func (void) { \
static unsigned int generation = 0; \
@@ -81,34 +79,15 @@ extern int darwinMainScreenX, darwinMainScreenY;
}
-DEFINE_ATOM_HELPER (xa_native_screen_origin, "_NATIVE_SCREEN_ORIGIN")
DEFINE_ATOM_HELPER (xa_native_window_id, "_NATIVE_WINDOW_ID")
-DEFINE_ATOM_HELPER (xa_apple_no_order_in, "_APPLE_NO_ORDER_IN")
-static Bool no_configure_window;
static Bool windows_hidden;
// TODO - abstract xp functions
-static inline int
-configure_window (xp_window_id id, unsigned int mask,
- const xp_window_changes *values)
-{
- if (!no_configure_window)
- return xp_configure_window (id, mask, values);
- else
- return XP_Success;
-}
-
-/*static inline unsigned long
-current_time_in_seconds (void)
-{
- unsigned long t = 0;
-
- t += currentTime.milliseconds / 1000;
- t += currentTime.months * 4294967;
+#ifdef __APPLE__
- return t;
- } */
+// XXX: identical to x_cvt_vptr_to_uint ?
+#define MAKE_WINDOW_ID(x) ((xp_window_id)((size_t)(x)))
void
RootlessNativeWindowStateChanged (WindowPtr pWin, unsigned int state)
@@ -160,25 +139,7 @@ void RootlessNativeWindowMoved (WindowPtr pWin) {
no_configure_window = FALSE;
}
-/* Updates the _NATIVE_SCREEN_ORIGIN property on the given root window. */
-static void
-set_screen_origin (WindowPtr pWin)
-{
- long data[2];
-
- if (!IsRoot (pWin))
- return;
-
- /* FIXME: move this to an extension? */
-
- data[0] = (dixScreenOrigins[pWin->drawable.pScreen->myNum].x
- + darwinMainScreenX);
- data[1] = (dixScreenOrigins[pWin->drawable.pScreen->myNum].y
- + darwinMainScreenY);
-
- dixChangeWindowProperty(serverClient, pWin, xa_native_screen_origin(),
- XA_INTEGER, 32, PropModeReplace, 2, data, TRUE);
-}
+#endif /* __APPLE__ */
/*
* RootlessCreateWindow
@@ -444,13 +405,6 @@ RootlessInitializeFrame(WindowPtr pWin, RootlessWindowRec *winRec)
#endif
}
-
-Bool
-RootlessColormapCallback (void *data, int first_color, int n_colors, uint32_t *colors)
-{
- return (RootlessResolveColormap (data, first_color, n_colors, colors) ? XP_Success : XP_BadMatch);
-}
-
/*
* RootlessEnsureFrame
* Make sure the given window is framed. If the window doesn't have a
@@ -1489,19 +1443,15 @@ void
RootlessFlushWindowColormap (WindowPtr pWin)
{
RootlessWindowRec *winRec = WINREC (pWin);
- xp_window_changes wc;
+ ScreenPtr pScreen = pWin->drawable.pScreen;
if (winRec == NULL)
return;
RootlessStopDrawing (pWin, FALSE);
- /* This is how we tell xp that the colormap may have changed. */
-
- wc.colormap = RootlessColormapCallback;
- wc.colormap_data = pWin->drawable.pScreen;
-
- configure_window (MAKE_WINDOW_ID(winRec->wid), XP_COLORMAP, &wc);
+ if (SCREENREC(pScreen)->imp->UpdateColormap)
+ SCREENREC(pScreen)->imp->UpdateColormap(winRec->wid, pScreen);
}
/*
@@ -1624,7 +1574,6 @@ RootlessHideAllWindows (void)
ScreenPtr pScreen;
WindowPtr pWin;
RootlessWindowRec *winRec;
- xp_window_changes wc;
if (windows_hidden)
return;
@@ -1648,9 +1597,8 @@ RootlessHideAllWindows (void)
winRec = WINREC (pWin);
if (winRec != NULL)
{
- wc.stack_mode = XP_UNMAPPED;
- wc.sibling = 0;
- configure_window (MAKE_WINDOW_ID(winRec->wid), XP_STACKING, &wc);
+ if (SCREENREC(pScreen)->imp->HideWindow)
+ SCREENREC(pScreen)->imp->HideWindow(winRec->wid);
}
}
}
diff --git a/xorg-server/miext/rootless/rootlessWindow.h b/xorg-server/miext/rootless/rootlessWindow.h
index 2d2555ea5..ca104a4d7 100644
--- a/xorg-server/miext/rootless/rootlessWindow.h
+++ b/xorg-server/miext/rootless/rootlessWindow.h
@@ -52,7 +52,9 @@ void RootlessResizeWindow(WindowPtr pWin, int x, int y,
unsigned int w, unsigned int h, WindowPtr pSib);
void RootlessReparentWindow(WindowPtr pWin, WindowPtr pPriorParent);
void RootlessChangeBorderWidth(WindowPtr pWin, unsigned int width);
+#ifdef __APPLE__
void RootlessNativeWindowMoved (WindowPtr pWin);
void RootlessNativeWindowStateChanged (WindowPtr pWin, unsigned int state);
+#endif
#endif