~ubuntu-branches/ubuntu/precise/xfwm4/precise-updates

« back to all changes in this revision

Viewing changes to debian/patches/01_filter-grab-ungrab-events.patch

  • Committer: Bazaar Package Importer
  • Author(s): Michael Casadevall
  • Date: 2008-11-10 07:40:26 UTC
  • mfrom: (1.1.20 upstream)
  • Revision ID: james.westby@ubuntu.com-20081110074026-xo3f144nja3wl7kz
Tags: 4.4.3-0ubuntu1
* Merge with Debian Xfce UNRELEASED, remaining Ubuntu changes
  - debian/xfwm4.1: update bug reporting address (LP instead of Debian BTS).
  - debian/rules: keep the .desktop installed, but add "NoDisplay=true" to hide
    them by default

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Index: xfce_4_4/src/client.c
2
 
===================================================================
3
 
--- xfce_4_4/src/client.c       (revision 26362)
4
 
+++ xfce_4_4/src/client.c       (revision 26363)
5
 
@@ -121,7 +121,7 @@
6
 
 };
7
 
 
8
 
 /* Forward decl */
9
 
-static void 
10
 
+static void
11
 
 clientUpdateIconPix (Client * c);
12
 
 
13
 
 Display *
14
 
@@ -348,8 +348,8 @@
15
 
         if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_VISIBLE))
16
 
         {
17
 
             c->blink_timeout_id =
18
 
-                g_timeout_add_full (G_PRIORITY_DEFAULT, 
19
 
-                                    CLIENT_BLINK_TIMEOUT, 
20
 
+                g_timeout_add_full (G_PRIORITY_DEFAULT,
21
 
+                                    CLIENT_BLINK_TIMEOUT,
22
 
                                     (GtkFunction) urgent_cb,
23
 
                                     (gpointer) c, NULL);
24
 
         }
25
 
@@ -1183,11 +1183,11 @@
26
 
     values.events = True;
27
 
 
28
 
     c->xsync_alarm = XSyncCreateAlarm (display_info->dpy,
29
 
-                                       XSyncCACounter | 
30
 
-                                       XSyncCADelta | 
31
 
-                                       XSyncCAEvents | 
32
 
-                                       XSyncCATestType | 
33
 
-                                       XSyncCAValue | 
34
 
+                                       XSyncCACounter |
35
 
+                                       XSyncCADelta |
36
 
+                                       XSyncCAEvents |
37
 
+                                       XSyncCATestType |
38
 
+                                       XSyncCAValue |
39
 
                                        XSyncCAValueType,
40
 
                                        &values);
41
 
     return (c->xsync_alarm != None);
42
 
@@ -1258,9 +1258,9 @@
43
 
     TRACE ("entering clientXSyncResetTimeout");
44
 
 
45
 
     clientXSyncClearTimeout (c);
46
 
-    c->xsync_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT, 
47
 
-                                              CLIENT_XSYNC_TIMEOUT, 
48
 
-                                              (GtkFunction) clientXSyncTimeout, 
49
 
+    c->xsync_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT,
50
 
+                                              CLIENT_XSYNC_TIMEOUT,
51
 
+                                              (GtkFunction) clientXSyncTimeout,
52
 
                                               (gpointer) c, NULL);
53
 
 }
54
 
 
55
 
@@ -1634,7 +1634,7 @@
56
 
 update_icon_idle_cb (gpointer data)
57
 
 {
58
 
     Client *c;
59
 
-    
60
 
+
61
 
     TRACE ("entering update_icon_idle_cb");
62
 
 
63
 
     c = (Client *) data;
64
 
@@ -1659,7 +1659,7 @@
65
 
 
66
 
     if (c->icon_timeout_id == 0)
67
 
     {
68
 
-        c->icon_timeout_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, 
69
 
+        c->icon_timeout_id = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
70
 
                                               update_icon_idle_cb, c, NULL);
71
 
     }
72
 
 }
73
 
@@ -1925,7 +1925,7 @@
74
 
         }
75
 
     }
76
 
 
77
 
-    /* 
78
 
+    /*
79
 
        Initialize "old" fields once the position is ensured, to avoid
80
 
        initially maximized or fullscreen windows being placed offscreen
81
 
        once de-maximized
82
 
@@ -2590,7 +2590,7 @@
83
 
         for (index = screen_info->windows_stack; index; index = g_list_next (index))
84
 
         {
85
 
             Client *c = (Client *) index->data;
86
 
-            if ((c->type & WINDOW_REGULAR_FOCUSABLE) 
87
 
+            if ((c->type & WINDOW_REGULAR_FOCUSABLE)
88
 
                 && !FLAG_TEST (c->flags, CLIENT_FLAG_ICONIFIED | CLIENT_FLAG_SKIP_TASKBAR))
89
 
             {
90
 
                 FLAG_SET (c->xfwm_flags, XFWM_FLAG_WAS_SHOWN);
91
 
@@ -2643,7 +2643,7 @@
92
 
     }
93
 
     else
94
 
     {
95
 
-        TRACE ("Setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window); 
96
 
+        TRACE ("Setting WM_STATE_DEMANDS_ATTENTION flag on \"%s\" (0x%lx)", c->name, c->window);
97
 
         FLAG_SET (c->flags, CLIENT_FLAG_DEMANDS_ATTENTION);
98
 
         clientSetNetState (c);
99
 
     }
100
 
@@ -2779,7 +2779,7 @@
101
 
             wc.y = c->y;
102
 
             mask |= (CWX | CWY);
103
 
         }
104
 
-        
105
 
+
106
 
         if (FLAG_TEST (c->xfwm_flags, XFWM_FLAG_VISIBLE))
107
 
         {
108
 
             c->ignore_unmap++;
109
 
@@ -4064,7 +4064,7 @@
110
 
 
111
 
     g1 = myScreenGrabKeyboard (screen_info, myDisplayGetCurrentTime (display_info));
112
 
     g2 = myScreenGrabPointer (screen_info, ButtonMotionMask | ButtonReleaseMask,
113
 
-                              myDisplayGetCursorMove (display_info), 
114
 
+                              myDisplayGetCursorMove (display_info),
115
 
                               myDisplayGetCurrentTime (display_info));
116
 
     if (!g1 || !g2)
117
 
     {
118
 
@@ -4470,7 +4470,7 @@
119
 
                 || (!clientCkeckTitle (c) && (frame_y < screen_info->margins [STRUTS_TOP])))
120
 
             {
121
 
                 temp = c->y + c->height;
122
 
-                c->y = CLAMP (c->y, screen_info->margins [STRUTS_TOP] + frame_top, 
123
 
+                c->y = CLAMP (c->y, screen_info->margins [STRUTS_TOP] + frame_top,
124
 
                          MAX (disp_max_y - min_visible,  screen_info->height - screen_info->margins [STRUTS_BOTTOM] - min_visible));
125
 
                 clientSetHeight (c, temp - c->y);
126
 
                 c->y = temp - c->height;
127
 
@@ -4956,32 +4956,39 @@
128
 
     status = EVENT_FILTER_STOP;
129
 
     pressed = TRUE;
130
 
 
131
 
-    if (xevent->type == EnterNotify)
132
 
+   switch (xevent->type)
133
 
     {
134
 
-        c->button_pressed[b] = TRUE;
135
 
-        frameDraw (c, FALSE);
136
 
+        case EnterNotify:
137
 
+            if ((xevent->xcrossing.mode != NotifyGrab) && (xevent->xcrossing.mode != NotifyUngrab))
138
 
+            {
139
 
+                c->button_pressed[b] = TRUE;
140
 
+                frameDraw (c, FALSE);
141
 
+            }
142
 
+            break;
143
 
+        case LeaveNotify:
144
 
+            if ((xevent->xcrossing.mode != NotifyGrab) && (xevent->xcrossing.mode != NotifyUngrab))
145
 
+            {
146
 
+                c->button_pressed[b] = FALSE;
147
 
+                frameDraw (c, FALSE);
148
 
+            }
149
 
+            break;
150
 
+        case ButtonRelease:
151
 
+            pressed = FALSE;
152
 
+            break;
153
 
+        case UnmapNotify:
154
 
+            if (xevent->xunmap.window == c->window)
155
 
+            {
156
 
+                pressed = FALSE;
157
 
+                c->button_pressed[b] = FALSE;
158
 
+            }
159
 
+            break;
160
 
+        case KeyPress:
161
 
+        case KeyRelease:
162
 
+            break;
163
 
+        default:
164
 
+            status = EVENT_FILTER_CONTINUE;
165
 
+            break;
166
 
     }
167
 
-    else if (xevent->type == LeaveNotify)
168
 
-    {
169
 
-        c->button_pressed[b] = FALSE;
170
 
-        frameDraw (c, FALSE);
171
 
-    }
172
 
-    else if (xevent->type == ButtonRelease)
173
 
-    {
174
 
-        pressed = FALSE;
175
 
-    }
176
 
-    else if ((xevent->type == UnmapNotify) && (xevent->xunmap.window == c->window))
177
 
-    {
178
 
-        pressed = FALSE;
179
 
-        c->button_pressed[b] = FALSE;
180
 
-    }
181
 
-    else if ((xevent->type == KeyPress) || (xevent->type == KeyRelease))
182
 
-    {
183
 
-    }
184
 
-    else
185
 
-    {
186
 
-        status = EVENT_FILTER_CONTINUE;
187
 
-    }
188
 
 
189
 
     if (!pressed)
190
 
     {