summaryrefslogtreecommitdiffstats
path: root/meta/recipes-sato/matchbox-desktop/files/window-resize-fix.patch
blob: 8970ac844523f8e6c0a812e67be2ea2a2074943f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
commit 2ef9a98cbda46b5a52e20ce292eebd6ba1f3c3a8
Author: Yu Ke <ke.yu@intel.com>
Date:   Sun Mar 6 17:58:45 2011 +0800

    desktop: Add configure event handler for desktop resize
    
    desktop need to resize its work area when window manager decorate its
    window. Originally it is done by the hook in root window PropertyNotify
    event handler, i.e. net_workarea_changed () routine. However, for unknown
    reason, the PropertyNotify event does not deliver to the root window,
    thus this routine does not work.
    
    this patch fix this issue from another side. Since window manager will also
    send configure event to desktop window after decoration, it also works to do
    it in configure event handler.
    
    Signed-off-by: Yu Ke <ke.yu@intel.com>

Upstream-Status: Pending

diff --git a/src/desktop.c b/src/desktop.c
index d4fc2fb..5aa2cfc 100644
--- a/src/desktop.c
+++ b/src/desktop.c
@@ -130,6 +130,15 @@ workarea_changed (int x, int y, int w, int h)
   gtk_fixed_move (GTK_FIXED (fixed), box, x, y);
 }
 
+static gboolean
+desktop_configure_callback(GtkWindow *window,
+		GdkEvent *event, gpointer data)
+{
+	gtk_widget_set_size_request (box, event->configure.width, event->configure.height);
+	gtk_widget_queue_resize (box);
+	return FALSE;
+}
+
 GtkWidget *
 create_desktop (void)
 {
@@ -176,6 +185,9 @@ create_desktop (void)
   /* Set a sane default in case there is no work area defined yet */
   workarea_changed (0, 0, screen_w, screen_h);
 
+  g_signal_connect(G_OBJECT(window), "configure-event",
+		  G_CALLBACK(desktop_configure_callback), NULL);
+
 #ifdef STANDALONE
   /* TODO: fake workarea_changed calls on window resize */
 #else