[Pkg-xfce-commits] r2026 - desktop/trunk/xfwm4/debian/patches

corsac at alioth.debian.org corsac at alioth.debian.org
Sat May 17 14:36:06 UTC 2008


Author: corsac
Date: 2008-05-17 14:36:03 +0000 (Sat, 17 May 2008)
New Revision: 2026

Added:
   desktop/trunk/xfwm4/debian/patches/03_fix-automaximize-on-move.patch
   desktop/trunk/xfwm4/debian/patches/04_exit-on-selectionclear.patch
   desktop/trunk/xfwm4/debian/patches/05_filter-grab-ungrab-events.patch
Log:
better if I do svn add the patches…


Added: desktop/trunk/xfwm4/debian/patches/03_fix-automaximize-on-move.patch
===================================================================
--- desktop/trunk/xfwm4/debian/patches/03_fix-automaximize-on-move.patch	                        (rev 0)
+++ desktop/trunk/xfwm4/debian/patches/03_fix-automaximize-on-move.patch	2008-05-17 14:36:03 UTC (rev 2026)
@@ -0,0 +1,95 @@
+Index: src/placement.c
+===================================================================
+--- src/placement.c	(revision 26965)
++++ src/placement.c	(revision 26966)
+@@ -390,7 +390,7 @@
+             frame_y = frameY (c);
+             ret |= CLIENT_CONSTRAINED_BOTTOM;
+         }
+-        if ((frame_y < disp_y) && (frame_y >= disp_y - frame_top))
++        if ((frame_y <= disp_y) && (frame_y >= disp_y - frame_top))
+         {
+             c->y = disp_y + frame_top;
+             frame_y = frameY (c);
+Index: src/client.c
+===================================================================
+--- src/client.c	(revision 26965)
++++ src/client.c	(revision 26966)
+@@ -3630,6 +3630,7 @@
+         {
+             int key_move = 16;
+             unsigned int edge;
++            int direction = 0;
+ 
+             if ((screen_info->params->snap_to_border) || (screen_info->params->snap_to_windows))
+             {
+@@ -3648,18 +3649,22 @@
+             }
+             if (xevent->xkey.keycode == screen_info->params->keys[KEY_MOVE_LEFT].keycode)
+             {
++                direction = KEY_MOVE_LEFT;
+                 c->x = c->x - key_move;
+             }
+             else if (xevent->xkey.keycode == screen_info->params->keys[KEY_MOVE_RIGHT].keycode)
+             {
++                direction = KEY_MOVE_RIGHT;
+                 c->x = c->x + key_move;
+             }
+             else if (xevent->xkey.keycode == screen_info->params->keys[KEY_MOVE_UP].keycode)
+             {
++                direction = KEY_MOVE_UP;
+                 c->y = c->y - key_move;
+             }
+             else if (xevent->xkey.keycode == screen_info->params->keys[KEY_MOVE_DOWN].keycode)
+             {
++                direction = KEY_MOVE_DOWN;
+                 c->y = c->y + key_move;
+             }
+ 
+@@ -3675,14 +3680,14 @@
+                 maxh = screen_info->height;
+                 clientMaxSpace (screen_info, &maxx, &maxy, &maxw, &maxh);
+ 
+-                if (edge & CLIENT_CONSTRAINED_TOP)
++                if ((edge & CLIENT_CONSTRAINED_TOP) && (direction == KEY_MOVE_UP))
+                 {
+                     if (workspaceMove (screen_info, -1, 0, c, xevent->xkey.time))
+                     {
+                         c->y = maxy + maxh;
+                     }
+                 }
+-                else if (edge & CLIENT_CONSTRAINED_BOTTOM)
++                else if ((edge & CLIENT_CONSTRAINED_BOTTOM) && (direction == KEY_MOVE_DOWN))
+                 {
+                     if (workspaceMove (screen_info, 1, 0, c, xevent->xkey.time))
+                     {
+@@ -3690,14 +3695,14 @@
+                     }
+                 }
+ 
+-                if (edge & CLIENT_CONSTRAINED_LEFT)
++                if ((edge & CLIENT_CONSTRAINED_LEFT) && (direction == KEY_MOVE_LEFT))
+                 {
+                     if (workspaceMove (screen_info, 0, -1, c, xevent->xkey.time))
+                     {
+                         c->x = maxx + maxw - frameWidth (c) + frameRight (c);
+                     }
+                 }
+-                else if (edge & CLIENT_CONSTRAINED_RIGHT)
++                else if ((edge & CLIENT_CONSTRAINED_RIGHT) && (direction == KEY_MOVE_RIGHT))
+                 {
+                     if (workspaceMove (screen_info, 0, 1, c, xevent->xkey.time))
+                     {
+Index: NEWS
+===================================================================
+--- NEWS	(revision 26965)
++++ NEWS	(revision 26966)
+@@ -1,3 +1,8 @@
++4.4.3
++=====
++
++- Fix automaximize on move
++
+ 4.4.2
+ =====
+ 

Added: desktop/trunk/xfwm4/debian/patches/04_exit-on-selectionclear.patch
===================================================================
--- desktop/trunk/xfwm4/debian/patches/04_exit-on-selectionclear.patch	                        (rev 0)
+++ desktop/trunk/xfwm4/debian/patches/04_exit-on-selectionclear.patch	2008-05-17 14:36:03 UTC (rev 2026)
@@ -0,0 +1,237 @@
+Index: src/events.c
+===================================================================
+--- src/events.c	(revision 26584)
++++ src/events.c	(revision 26585)
+@@ -71,7 +71,7 @@
+                                  PointerMotionMask | \
+                                  ButtonPressMask | \
+                                  ButtonReleaseMask)
+-                  
++
+ #define MODIFIER_MASK           (ShiftMask | \
+                                  ControlMask | \
+                                  AltMask | \
+@@ -238,7 +238,7 @@
+     passdata.ycurrent = passdata.y;
+     passdata.clicks = 1;
+     passdata.allow_double_click = allow_double_click;
+-    passdata.timeout = g_timeout_add_full (G_PRIORITY_DEFAULT, 
++    passdata.timeout = g_timeout_add_full (G_PRIORITY_DEFAULT,
+                                            display_info->dbl_click_time,
+                                            (GtkFunction) typeOfClick_break,
+                                            (gpointer) &passdata, NULL);
+@@ -304,9 +304,9 @@
+     {
+         g_source_remove (raise_timeout);
+     }
+-    raise_timeout = g_timeout_add_full (G_PRIORITY_DEFAULT, 
+-                                        screen_info->params->raise_delay, 
+-                                        (GtkFunction) raise_cb, 
++    raise_timeout = g_timeout_add_full (G_PRIORITY_DEFAULT,
++                                        screen_info->params->raise_delay,
++                                        (GtkFunction) raise_cb,
+                                         NULL, NULL);
+ }
+ 
+@@ -487,13 +487,13 @@
+                 }
+                 break;
+             case KEY_POPUP_MENU:
+-                /* 
+-                   We need to release the events here prior to grabbing 
++                /*
++                   We need to release the events here prior to grabbing
+                    the keyboard in gtk menu otherwise we end with a dead lock...
+                   */
+                 XAllowEvents (display_info->dpy, AsyncKeyboard, CurrentTime);
+-                show_window_menu (c, frameX (c) + frameLeft (c), 
+-                                     frameY (c) + frameTop (c), 
++                show_window_menu (c, frameX (c) + frameLeft (c),
++                                     frameY (c) + frameTop (c),
+                                      Button1, GDK_CURRENT_TIME);
+                 /* 'nuff for now */
+                 return;
+@@ -620,7 +620,7 @@
+     }
+ }
+ 
+-static int 
++static int
+ edgeGetPart (Client *c, XButtonEvent * ev)
+ {
+     int part, x_corner_pixels, y_corner_pixels, x_distance, y_distance;
+@@ -1432,22 +1432,22 @@
+             constrained = TRUE;
+         }
+ 
+-        /* 
+-           Let's say that if the client performs a XRaiseWindow, we show the window if focus 
++        /*
++           Let's say that if the client performs a XRaiseWindow, we show the window if focus
+            stealing prevention is not activated, otherwise we just set the "demands attention"
+            flag...
+          */
+         if ((ev->value_mask & CWStackMode) && (wc.stack_mode == Above) && (wc.sibling == None))
+         {
+             Client *last_raised;
+-            
++
+             last_raised = clientGetLastRaise (screen_info);
+             if (last_raised && (c != last_raised))
+             {
+                 if ((screen_info->params->prevent_focus_stealing) && (screen_info->params->activate_action == ACTIVATE_ACTION_NONE))
+                 {
+                     ev->value_mask &= ~(CWSibling | CWStackMode);
+-                    TRACE ("Setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window); 
++                    TRACE ("Setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window);
+                     FLAG_SET (c->flags, CLIENT_FLAG_DEMANDS_ATTENTION);
+                     clientSetNetState (c);
+                 }
+@@ -1680,10 +1680,10 @@
+     }
+ 
+     if ((ev->window == screen_info->xroot)
+-        && ((ev->detail == NotifyDetailNone) 
++        && ((ev->detail == NotifyDetailNone)
+             || ((ev->mode == NotifyNormal) && (ev->detail == NotifyInferior))))
+     {
+-        /* 
++        /*
+            Handle unexpected focus transition to root (means that an unknown
+            window has vanished and the focus is returned to the root).
+          */
+@@ -1710,10 +1710,10 @@
+         clientUpdateFocus (screen_info, c, FOCUS_SORT);
+         if ((user_focus != c) && (user_focus != NULL))
+         {
+-            /* 
++            /*
+                Focus stealing prevention:
+-               Some apps tend to focus the window directly. If focus stealing prevention is enabled, 
+-               we revert the user set focus to the window that we think has focus and then set the 
++               Some apps tend to focus the window directly. If focus stealing prevention is enabled,
++               we revert the user set focus to the window that we think has focus and then set the
+                demand attention flag.
+ 
+                Note that focus stealing prevention is ignored between windows of the same group or
+@@ -1725,12 +1725,12 @@
+                 !clientSameGroup (c, user_focus) &&
+                 !clientIsTransientOrModalFor (c, user_focus))
+             {
+-                TRACE ("Setting focus back to \"%s\" (0x%lx)", user_focus->name, user_focus->window); 
++                TRACE ("Setting focus back to \"%s\" (0x%lx)", user_focus->name, user_focus->window);
+                 clientSetFocus (user_focus->screen_info, user_focus, getXServerTime (display_info), NO_FOCUS_FLAG);
+ 
+                 if (current_focus)
+                 {
+-                    TRACE ("Setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window); 
++                    TRACE ("Setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window);
+                     FLAG_SET (c->flags, CLIENT_FLAG_DEMANDS_ATTENTION);
+                     clientSetNetState (c);
+                 }
+@@ -1779,7 +1779,7 @@
+                 "NotifyDetailNone" :
+                 "(unknown)");
+ 
+-    if ((ev->mode == NotifyGrab) || (ev->mode == NotifyUngrab) || 
++    if ((ev->mode == NotifyGrab) || (ev->mode == NotifyUngrab) ||
+         (ev->detail == NotifyInferior) || (ev->detail > NotifyNonlinearVirtual))
+     {
+         /* We're not interested in such notifications */
+@@ -1871,19 +1871,19 @@
+             if (clientCheckTransientWindow (c, w))
+             {
+                 c->transient_for = w;
+-#if 0                
++#if 0
+                 /*
+                   Java 1.6 updates the WM_TRANSIENT_FOR properties "on-the-fly"
+-                  of its windows to maintain the z-order. 
+-                  
+-                  If we raise the transient then, we clearly have a race 
+-                  condition between the WM and Java... And that breaks 
++                  of its windows to maintain the z-order.
++
++                  If we raise the transient then, we clearly have a race
++                  condition between the WM and Java... And that breaks
+                   the z-order. Bug #2483.
+-                  
++
+                   I still think that raising here makes sense, to ensure
+                   that the newly promoted transient window is placed above
+                   its parent.
+-                  
++
+                   Chances are that Java 1.6 won't change any time soon (heh,
+                   it's not even released yet), so let's adjust the WM to
+                   work with Java 1.6...
+@@ -2105,7 +2105,7 @@
+                 TRACE ("Time of event received is %u, current XServer time is %u", (unsigned int) ev_time, (unsigned int) current);
+                 if ((screen_info->params->prevent_focus_stealing) && TIMESTAMP_IS_BEFORE(ev_time, current))
+                 {
+-                    TRACE ("Setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window); 
++                    TRACE ("Setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window);
+                     FLAG_SET (c->flags, CLIENT_FLAG_DEMANDS_ATTENTION);
+                     clientSetNetState (c);
+                 }
+@@ -2139,10 +2139,10 @@
+              (ev->message_type == display_info->atoms[NET_CURRENT_DESKTOP])) && (ev->format == 32))
+         {
+             TRACE ("root has received a win_workspace or a NET_CURRENT_DESKTOP event %li", ev->data.l[0]);
+-            if ((ev->data.l[0] >= 0) && (ev->data.l[0] < screen_info->workspace_count) && 
++            if ((ev->data.l[0] >= 0) && (ev->data.l[0] < screen_info->workspace_count) &&
+                 (ev->data.l[0] != screen_info->current_ws))
+             {
+-                workspaceSwitch (screen_info, ev->data.l[0], NULL, TRUE, 
++                workspaceSwitch (screen_info, ev->data.l[0], NULL, TRUE,
+                                  myDisplayGetTime (display_info, (Time) ev->data.l[1]));
+             }
+         }
+@@ -2176,10 +2176,10 @@
+         else if ((ev->message_type == display_info->atoms[MANAGER]) && (ev->format == 32))
+         {
+             Atom selection;
+-            
++
+             TRACE ("window (0x%lx) has received a MANAGER event", ev->window);
+             selection = (Atom) ev->data.l[1];
+-            
++
+ #ifdef ENABLE_KDE_SYSTRAY_PROXY
+             if (selection == screen_info->net_system_tray_selection)
+             {
+@@ -2202,6 +2202,24 @@
+ }
+ 
+ static void
++handleSelectionClear (DisplayInfo *display_info, XSelectionClearEvent * ev)
++{
++    ScreenInfo *screen_info;
++
++    TRACE ("entering handleSelectionClear");
++
++    screen_info = myDisplayGetScreenFromWindow (display_info, ev->window);
++    if (screen_info)
++    {
++        if (myScreenCheckWMAtom (screen_info, ev->selection))
++        {
++            TRACE ("root has received a WM_Sn selection event");
++            display_info->quit = TRUE;
++        }
++    }
++}
++
++static void
+ handleShape (DisplayInfo *display_info, XShapeEvent * ev)
+ {
+     Client *c;
+@@ -2366,6 +2384,9 @@
+         case ClientMessage:
+             handleClientMessage (display_info, (XClientMessageEvent *) ev);
+             break;
++        case SelectionClear:
++            handleSelectionClear (display_info, (XSelectionClearEvent *) ev);
++            break;
+         case ColormapNotify:
+             handleColormapNotify (display_info, (XColormapEvent *) ev);
+             break;

Added: desktop/trunk/xfwm4/debian/patches/05_filter-grab-ungrab-events.patch
===================================================================
--- desktop/trunk/xfwm4/debian/patches/05_filter-grab-ungrab-events.patch	                        (rev 0)
+++ desktop/trunk/xfwm4/debian/patches/05_filter-grab-ungrab-events.patch	2008-05-17 14:36:03 UTC (rev 2026)
@@ -0,0 +1,190 @@
+Index: src/client.c
+===================================================================
+--- src/client.c	(revision 26362)
++++ src/client.c	(revision 26363)
+@@ -121,7 +121,7 @@
+ };
+ 
+ /* Forward decl */
+-static void 
++static void
+ clientUpdateIconPix (Client * c);
+ 
+ Display *
+@@ -348,8 +348,8 @@
+         if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_VISIBLE))
+         {
+             c->blink_timeout_id =
+-                g_timeout_add_full (G_PRIORITY_DEFAULT, 
+-                                    CLIENT_BLINK_TIMEOUT, 
++                g_timeout_add_full (G_PRIORITY_DEFAULT,
++                                    CLIENT_BLINK_TIMEOUT,
+                                     (GtkFunction) urgent_cb,
+                                     (gpointer) c, NULL);
+         }
+@@ -1183,11 +1183,11 @@
+     values.events = True;
+ 
+     c->xsync_alarm = XSyncCreateAlarm (display_info->dpy,
+-                                       XSyncCACounter | 
+-                                       XSyncCADelta | 
+-                                       XSyncCAEvents | 
+-                                       XSyncCATestType | 
+-                                       XSyncCAValue | 
++                                       XSyncCACounter |
++                                       XSyncCADelta |
++                                       XSyncCAEvents |
++                                       XSyncCATestType |
++                                       XSyncCAValue |
+                                        XSyncCAValueType,
+                                        &values);
+     return (c->xsync_alarm != None);
+@@ -1258,9 +1258,9 @@
+     TRACE ("entering clientXSyncResetTimeout");
+ 
+     clientXSyncClearTimeout (c);
+-    c->xsync_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT, 
+-                                              CLIENT_XSYNC_TIMEOUT, 
+-                                              (GtkFunction) clientXSyncTimeout, 
++    c->xsync_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT,
++                                              CLIENT_XSYNC_TIMEOUT,
++                                              (GtkFunction) clientXSyncTimeout,
+                                               (gpointer) c, NULL);
+ }
+ 
+@@ -1634,7 +1634,7 @@
+ update_icon_idle_cb (gpointer data)
+ {
+     Client *c;
+-    
++
+     TRACE ("entering update_icon_idle_cb");
+ 
+     c = (Client *) data;
+@@ -1659,7 +1659,7 @@
+ 
+     if (c->icon_timeout_id == 0)
+     {
+-        c->icon_timeout_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, 
++        c->icon_timeout_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
+                                               update_icon_idle_cb, c, NULL);
+     }
+ }
+@@ -1925,7 +1925,7 @@
+         }
+     }
+ 
+-    /* 
++    /*
+        Initialize "old" fields once the position is ensured, to avoid
+        initially maximized or fullscreen windows being placed offscreen
+        once de-maximized
+@@ -2590,7 +2590,7 @@
+         for (index = screen_info->windows_stack; index; index = g_list_next (index))
+         {
+             Client *c = (Client *) index->data;
+-            if ((c->type & WINDOW_REGULAR_FOCUSABLE) 
++            if ((c->type & WINDOW_REGULAR_FOCUSABLE)
+                 && !FLAG_TEST (c->flags, CLIENT_FLAG_ICONIFIED | CLIENT_FLAG_SKIP_TASKBAR))
+             {
+                 FLAG_SET (c->xfwm_flags, XFWM_FLAG_WAS_SHOWN);
+@@ -2643,7 +2643,7 @@
+     }
+     else
+     {
+-        TRACE ("Setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window); 
++        TRACE ("Setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window);
+         FLAG_SET (c->flags, CLIENT_FLAG_DEMANDS_ATTENTION);
+         clientSetNetState (c);
+     }
+@@ -2779,7 +2779,7 @@
+             wc.y = c->y;
+             mask |= (CWX | CWY);
+         }
+-        
++
+         if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_VISIBLE))
+         {
+             c->ignore_unmap++;
+@@ -4064,7 +4064,7 @@
+ 
+     g1 = myScreenGrabKeyboard (screen_info, myDisplayGetCurrentTime (display_info));
+     g2 = myScreenGrabPointer (screen_info, ButtonMotionMask | ButtonReleaseMask,
+-                              myDisplayGetCursorMove (display_info), 
++                              myDisplayGetCursorMove (display_info),
+                               myDisplayGetCurrentTime (display_info));
+     if (!g1 || !g2)
+     {
+@@ -4470,7 +4470,7 @@
+                 || (!clientCkeckTitle (c) && (frame_y < screen_info->margins [STRUTS_TOP])))
+             {
+                 temp = c->y + c->height;
+-                c->y = CLAMP (c->y, screen_info->margins [STRUTS_TOP] + frame_top, 
++                c->y = CLAMP (c->y, screen_info->margins [STRUTS_TOP] + frame_top,
+                          MAX (disp_max_y - min_visible,  screen_info->height - screen_info->margins [STRUTS_BOTTOM] - min_visible));
+                 clientSetHeight (c, temp - c->y);
+                 c->y = temp - c->height;
+@@ -4956,32 +4956,39 @@
+     status = EVENT_FILTER_STOP;
+     pressed = TRUE;
+ 
+-    if (xevent->type == EnterNotify)
++   switch (xevent->type)
+     {
+-        c->button_pressed[b] = TRUE;
+-        frameDraw (c, FALSE);
++        case EnterNotify:
++            if ((xevent->xcrossing.mode != NotifyGrab) && (xevent->xcrossing.mode != NotifyUngrab))
++            {
++                c->button_pressed[b] = TRUE;
++                frameDraw (c, FALSE);
++            }
++            break;
++        case LeaveNotify:
++            if ((xevent->xcrossing.mode != NotifyGrab) && (xevent->xcrossing.mode != NotifyUngrab))
++            {
++                c->button_pressed[b] = FALSE;
++                frameDraw (c, FALSE);
++            }
++            break;
++        case ButtonRelease:
++            pressed = FALSE;
++            break;
++        case UnmapNotify:
++            if (xevent->xunmap.window == c->window)
++            {
++                pressed = FALSE;
++                c->button_pressed[b] = FALSE;
++            }
++            break;
++        case KeyPress:
++        case KeyRelease:
++            break;
++        default:
++            status = EVENT_FILTER_CONTINUE;
++            break;
+     }
+-    else if (xevent->type == LeaveNotify)
+-    {
+-        c->button_pressed[b] = FALSE;
+-        frameDraw (c, FALSE);
+-    }
+-    else if (xevent->type == ButtonRelease)
+-    {
+-        pressed = FALSE;
+-    }
+-    else if ((xevent->type == UnmapNotify) && (xevent->xunmap.window == c->window))
+-    {
+-        pressed = FALSE;
+-        c->button_pressed[b] = FALSE;
+-    }
+-    else if ((xevent->type == KeyPress) || (xevent->type == KeyRelease))
+-    {
+-    }
+-    else
+-    {
+-        status = EVENT_FILTER_CONTINUE;
+-    }
+ 
+     if (!pressed)
+     {




More information about the Pkg-xfce-commits mailing list