Initial support for Spaces -- if you use Expose to drag an X11

window to another Space, it will work correctly (as opposed
to just leaving a ghost window).  We accomplish this by listening
for the notification from Xplugin that our window has been moved,
and then we ask X11 to move the window to the new location.
This commit is contained in:
Ben Byer 2007-11-03 05:34:19 -07:00 committed by Jeremy Huddleston
parent b6681aff2b
commit 2d50ea8013
3 changed files with 25 additions and 7 deletions

View File

@ -400,9 +400,16 @@ void DarwinModeProcessEvent(
break;
case kXDarwinWindowState:
case kXDarwinWindowMoved:
// FIXME: Not implemented yet
break;
ErrorF("kXDarwinWindowState\n");
break;
case kXDarwinWindowMoved: {
WindowPtr pWin = (WindowPtr)xe->u.clientMessage.u.l.longs0;
short x = xe->u.clientMessage.u.l.longs1,
y = xe->u.clientMessage.u.l.longs2;
ErrorF("kXDarwinWindowMoved(%p, %hd, %hd)\n", pWin, x, y);
RootlessMoveWindow(pWin, x, y, pWin->nextSib, VTMove);
}
break;
default:
ErrorF("Unknown application defined event type %d.\n",

View File

@ -68,6 +68,7 @@ static inline xp_error
xprConfigureWindow(xp_window_id id, unsigned int mask,
const xp_window_changes *values)
{
// ErrorF("xprConfigureWindow()\n");
if (!no_configure_window)
return xp_configure_window(id, mask, values);
else
@ -185,7 +186,7 @@ xprMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY)
wc.x = newX;
wc.y = newY;
// ErrorF("xprMoveFrame(%d, %p, %d, %d)\n", wid, pScreen, newX, newY);
xprConfigureWindow((xp_window_id) wid, XP_ORIGIN, &wc);
}
@ -411,7 +412,7 @@ xprInit(ScreenPtr pScreen)
* Given the id of a physical window, try to find the top-level (or root)
* X window that it represents.
*/
static WindowPtr
WindowPtr
xprGetXWindow(xp_window_id wid)
{
RootlessWindowRec *winRec;

View File

@ -61,10 +61,12 @@ eventHandler(unsigned int type, const void *arg,
switch (type)
{
case XP_EVENT_DISPLAY_CHANGED:
// ErrorF("XP_EVENT_DISPLAY_MOVED\n");
QuartzMessageServerThread(kXDarwinDisplayChanged, 0);
break;
case XP_EVENT_WINDOW_STATE_CHANGED:
// ErrorF("XP_EVENT_WINDOW_STATE_CHANGED\n");
if (arg_size >= sizeof(xp_window_state_event))
{
const xp_window_state_event *ws_arg = arg;
@ -75,16 +77,24 @@ eventHandler(unsigned int type, const void *arg,
break;
case XP_EVENT_WINDOW_MOVED:
// ErrorF("XP_EVENT_WINDOW_MOVED\n");
if (arg_size == sizeof(xp_window_id))
{
xp_window_id id = * (xp_window_id *) arg;
QuartzMessageServerThread(kXDarwinWindowMoved, 1, id);
WindowPtr pWin = xprGetXWindow(id);
BoxRec box;
xp_error retval = xp_get_window_bounds(id, &box);
if (retval != Success) {
ErrorF("Unable to find new bounds for window\n");
break;
}
QuartzMessageServerThread(kXDarwinWindowMoved, 3, pWin, box.x1, box.y1);
}
break;
case XP_EVENT_SURFACE_DESTROYED:
case XP_EVENT_SURFACE_CHANGED:
// ErrorF("XP_EVENT_SURFACE_MOVED\n");
if (arg_size == sizeof(xp_surface_id))
{
int kind;