--- xfwm4-4.2.2/src/events.c.resist 2005-05-15 04:43:13.000000000 -0400 +++ xfwm4-4.2.2/src/events.c 2005-09-12 11:45:04.000000000 -0400 @@ -37,6 +37,7 @@ #include #include #include +#include #include "misc.h" #include "workspaces.h" @@ -334,8 +335,10 @@ handleMotionNotify (DisplayInfo *display { int msx, msy, maxx, maxy; ScreenInfo *screen_info = NULL; + static Time lastresist = (Time) 0; TRACE ("entering handleMotionNotify"); + fprintf(stderr,"entering handleMotionNotify\n"); if (display_info->nb_screens > 1) { @@ -361,19 +364,45 @@ handleMotionNotify (DisplayInfo *display if ((msx == 0) || (msx == maxx)) { - edge_scroll_x++; - } - else - { - edge_scroll_x = 0; + if ((ev->time - lastresist) > 250) /* ms */ + { + fprintf(stderr,"Resetting edge_scroll_x\n"); + edge_scroll_x = 0; + } + else + { + edge_scroll_x++; + fprintf(stderr,"edge_scroll_x = %d (%d)\n", edge_scroll_x, screen_info->params->wrap_resistance); + } + if (msx == 0) { + XWarpPointer (display_info->dpy, None, screen_info->xroot, 0, 0, 0, 0, 1, msy); + } + else + { + XWarpPointer (display_info->dpy, None, screen_info->xroot, 0, 0, 0, 0, maxx - 1, msy); + } + lastresist = ev->time; } if ((msy == 0) || (msy == maxy)) { - edge_scroll_y++; - } - else - { - edge_scroll_y = 0; + if ((ev->time - lastresist) > 250) /* ms */ + { + fprintf(stderr,"Resetting edge_scroll_y\n"); + edge_scroll_y = 0; + } + else + { + edge_scroll_y++; + fprintf(stderr,"edge_scroll_y = %d (%d)\n", edge_scroll_y, screen_info->params->wrap_resistance); + } + if (msy == 0) { + XWarpPointer (display_info->dpy, None, screen_info->xroot, 0, 0, 0, 0, msx, 1); + } + else + { + XWarpPointer (display_info->dpy, None, screen_info->xroot, 0, 0, 0, 0, msx, maxy - 1); + } + lastresist = ev->time; } if (edge_scroll_x > screen_info->params->wrap_resistance) @@ -1406,8 +1435,11 @@ static void handleEnterNotify (DisplayInfo *display_info, XCrossingEvent * ev) { Client *c = NULL; + ScreenInfo *screen_info = NULL; + int msx, msy, maxx, maxy; TRACE ("entering handleEnterNotify"); + fprintf (stderr,"entering handleEnterNotify\n"); if ((ev->mode == NotifyGrab) || (ev->mode == NotifyUngrab) || (ev->detail > NotifyNonlinearVirtual)) @@ -1417,23 +1449,66 @@ handleEnterNotify (DisplayInfo *display_ } TRACE ("EnterNotify on window (0x%lx)", ev->window); + fprintf (stderr,"EnterNotify on window (0x%lx)\n", ev->window); c = myDisplayGetClientFromWindow (display_info, ev->window, FRAME); if (c) { - ScreenInfo *screen_info = NULL; - screen_info = c->screen_info; if (!(screen_info->params->click_to_focus) && clientAcceptFocus (c)) { TRACE ("EnterNotify window is \"%s\"", c->name); + fprintf (stderr,"EnterNotify window is \"%s\"\n", c->name); if (!(c->type & (WINDOW_DOCK | WINDOW_DESKTOP))) { clientSetFocus (c->screen_info, c, ev->time, NO_FOCUS_FLAG); } } } + + /* Get the screen structure from the root of the event */ + screen_info = myDisplayGetScreenFromRoot (display_info, ev->root); + + if (!screen_info) + { + return; + } + + if (screen_info->workspace_count && screen_info->params->wrap_workspaces + && screen_info->params->wrap_resistance) + { + fprintf(stderr,"Checking if in sidewalk\n"); + if ((ev->window == MYWINDOW_XWINDOW (screen_info->sidewalk[0])) || + (ev->window == MYWINDOW_XWINDOW (screen_info->sidewalk[1])) || + (ev->window == MYWINDOW_XWINDOW (screen_info->sidewalk[2])) || + (ev->window == MYWINDOW_XWINDOW (screen_info->sidewalk[3]))) + { + TRACE ("Entered sidewalk"); + fprintf(stderr,"Entered sidewalk\n"); + edge_scroll_x = 0; + edge_scroll_y = 0; + msx = ev->x_root; + msy = ev->y_root; + maxx = gdk_screen_get_width (screen_info->gscr) - 1; + maxy = gdk_screen_get_height (screen_info->gscr) - 1; + + if (msx == 0) { + XWarpPointer (display_info->dpy, None, screen_info->xroot, 0, 0, 0, 0, 1, msy); + } + else if (msx == maxx) + { + XWarpPointer (display_info->dpy, None, screen_info->xroot, 0, 0, 0, 0, maxx - 1, msy); + } + if (msy == 0) { + XWarpPointer (display_info->dpy, None, screen_info->xroot, 0, 0, 0, 0, msx, 1); + } + else if (msy == maxy) + { + XWarpPointer (display_info->dpy, None, screen_info->xroot, 0, 0, 0, 0, msx, maxy - 1); + } + } + } } static void @@ -1442,6 +1517,7 @@ handleLeaveNotify (DisplayInfo *display_ ScreenInfo *screen_info = NULL; TRACE ("entering handleLeaveNotify"); + fprintf (stderr,"entering handleLeaveNotify\n"); if ((ev->mode == NotifyGrab) || (ev->mode == NotifyUngrab) || (ev->detail > NotifyNonlinearVirtual)) @@ -1462,6 +1538,7 @@ handleLeaveNotify (DisplayInfo *display_ (ev->window == MYWINDOW_XWINDOW (screen_info->sidewalk[3]))) { TRACE ("Reset edge_scroll_x and edge_scroll_y"); + fprintf (stderr,"Leaving sidewalk, Reset edge_scroll_x and edge_scroll_y\n"); edge_scroll_x = 0; edge_scroll_y = 0; } @@ -1891,7 +1968,7 @@ handleClientMessage (DisplayInfo *displa } else if (ev->message_type == display_info->atoms[NET_REQUEST_FRAME_EXTENTS]) { - TRACE ("window (0x%lx) has received a net_request_frame_extents event", c->name, ev->window); + TRACE ("client \"%s\" (window 0x%lx) has received a net_request_frame_extents event", c->name, ev->window); /* Size estimate from the decoration extents */ setNetFrameExtents (display_info, ev->window, frameDecorationTop (screen_info), --- xfwm4-4.2.2/src/misc.c.resist 2005-05-15 04:43:13.000000000 -0400 +++ xfwm4-4.2.2/src/misc.c 2005-09-12 11:41:53.000000000 -0400 @@ -156,17 +156,17 @@ placeSidewalks(ScreenInfo *screen_info, if (activate) { xfwmWindowShow (&screen_info->sidewalk[0], - 0, 0, - 1, gdk_screen_get_height (screen_info->gscr), FALSE); + /*left*/ 0, 0, + 2, gdk_screen_get_height (screen_info->gscr), FALSE); xfwmWindowShow (&screen_info->sidewalk[1], - gdk_screen_get_width (screen_info->gscr) - 1, 0, - 1, gdk_screen_get_height (screen_info->gscr), FALSE); + /*right*/ gdk_screen_get_width (screen_info->gscr) - 2, 0, + 2, gdk_screen_get_height (screen_info->gscr), FALSE); xfwmWindowShow (&screen_info->sidewalk[2], - 0, 0, - gdk_screen_get_width (screen_info->gscr), 1, FALSE); + /*top*/ 0, 0, + gdk_screen_get_width (screen_info->gscr), 2, FALSE); xfwmWindowShow (&screen_info->sidewalk[3], - 0, gdk_screen_get_height (screen_info->gscr) - 1, - gdk_screen_get_width (screen_info->gscr), 1, FALSE); + /*bottom*/ 0, gdk_screen_get_height (screen_info->gscr) - 2, + gdk_screen_get_width (screen_info->gscr), 2, FALSE); } else { --- xfwm4-4.2.2/src/screen.c~ 2005-09-12 11:54:41.000000000 -0400 +++ xfwm4-4.2.2/src/screen.c 2005-09-12 11:54:41.000000000 -0400 @@ -126,22 +126,22 @@ myScreenInit (DisplayInfo *display_info, xfwmWindowTemp (display_info->dpy, screen_info->xroot, &screen_info->sidewalk[0], 0, 0, 1, gdk_screen_get_height (gscr), - LeaveWindowMask | PointerMotionMask); + EnterWindowMask | LeaveWindowMask | PointerMotionMask); xfwmWindowTemp (display_info->dpy, screen_info->xroot, &screen_info->sidewalk[1], gdk_screen_get_width (gscr) - 1, 0, 1, gdk_screen_get_height (gscr), - LeaveWindowMask | PointerMotionMask); + EnterWindowMask | LeaveWindowMask | PointerMotionMask); xfwmWindowTemp (display_info->dpy, screen_info->xroot, &screen_info->sidewalk[2], 0, 0, gdk_screen_get_width (gscr), 1, - LeaveWindowMask | PointerMotionMask); + EnterWindowMask | LeaveWindowMask | PointerMotionMask); xfwmWindowTemp (display_info->dpy, screen_info->xroot, &screen_info->sidewalk[3], 0, gdk_screen_get_height (gscr) - 1, gdk_screen_get_width (gscr), 1, - LeaveWindowMask | PointerMotionMask); + EnterWindowMask | LeaveWindowMask | PointerMotionMask); screen_info->gnome_win = GDK_WINDOW_XWINDOW (screen_info->gtk_win->window);