~hypodermia/ubuntu/oneiric/compiz/fix-for-bug-301174

« back to all changes in this revision

Viewing changes to debian/patches/01_unity_window_decorator.patch

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2011-02-24 17:31:29 UTC
  • mfrom: (0.167.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110224173129-hsczyk7yw7s21flf
Tags: 1:0.9.4-0ubuntu1
* New upstream release:
  - Fix no windows receiving the focus if someone got the focus then was
    destroyed
  - Fix crash when resizing using keybindings
  - Fix unresponsive inactive decorations (LP: #703755) 
  - Fix the long awaited gconf crash (LP: #691561)
  - gtk-window-decorator doesn't respect special decoration styles
    (LP: #290835)
* debian/compiz-core.links,
  debian/source_compiz.py,
  debian/compiz-core.install:
  - install again a richer apport hook to redirect nux/libunity/unityshell
    crash. It also asks the user to redirect unity issues against unity (still
    incuding xorg info when needed)
* Removed a bunch of patches either cherry-picked or pushed upstream. With the
  other fixes, the gconf workaround is hopefully not needed anymore.
* refresh existing patches to still apply
* debian/control:
  - rename dep on compiz-fusion* to compiz*
* debian/patches/085_add_grid_plugin.patch:
  - refresh the grid plugin from new release
* debian/patches/086_new_grid_defaults.patch
  - separate tweaking the default settings to only have the effect that were
    specified:
    top -> maximize, left (top or bottom left) -> window half left of the
    screen, right (top or bottom right) -> window half right of the screen,
    bottom -> do nothing

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
 create mode 100644 unity/unity_window_decorator/src/util.c
63
63
 create mode 100644 unity/unity_window_decorator/src/wnck.c
64
64
 
65
 
Index: compiz-0.9.2.1+glibmainloop4/CMakeLists.txt
 
65
Index: compiz-0.9.4/CMakeLists.txt
66
66
===================================================================
67
 
--- compiz-0.9.2.1+glibmainloop4.orig/CMakeLists.txt    2011-01-13 15:38:38.000000000 +0100
68
 
+++ compiz-0.9.2.1+glibmainloop4/CMakeLists.txt 2011-01-19 16:49:57.746695001 +0100
 
67
--- compiz-0.9.4.orig/CMakeLists.txt    2011-02-24 17:27:13.000000000 +0800
 
68
+++ compiz-0.9.4/CMakeLists.txt 2011-02-24 18:43:30.768529107 +0800
69
69
@@ -112,6 +112,7 @@
70
70
 add_subdirectory (libdecoration)
71
71
 add_subdirectory (gtk)
74
74
 add_subdirectory (po)
75
75
 add_subdirectory (metadata)
76
76
 add_subdirectory (src)
77
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/.gitignore
 
77
Index: compiz-0.9.4/unity/unity_window_decorator/.gitignore
78
78
===================================================================
79
79
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
80
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/.gitignore        2011-01-19 16:49:57.750695001 +0100
 
80
+++ compiz-0.9.4/unity/unity_window_decorator/.gitignore        2011-02-24 18:43:30.768529107 +0800
81
81
@@ -0,0 +1 @@
82
82
+po/compiz.pot
83
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/AUTHORS
 
83
Index: compiz-0.9.4/unity/unity_window_decorator/AUTHORS
84
84
===================================================================
85
85
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
86
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/AUTHORS   2011-01-19 16:49:57.754695001 +0100
 
86
+++ compiz-0.9.4/unity/unity_window_decorator/AUTHORS   2011-02-24 18:43:30.788529139 +0800
87
87
@@ -0,0 +1,29 @@
88
88
+compiz and the standard set of plugins are designed and written by
89
89
+
114
114
+Julian Sikorski <lordzanon@poczta.onet.pl>
115
115
+Quinn Storm <livinglatexkali@gmail.com>
116
116
+Erkin Bahceci <erkinbah@gmail.com>
117
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/CMakeLists.txt
 
117
Index: compiz-0.9.4/unity/unity_window_decorator/CMakeLists.txt
118
118
===================================================================
119
119
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
120
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/CMakeLists.txt    2011-01-19 16:49:57.754695001 +0100
 
120
+++ compiz-0.9.4/unity/unity_window_decorator/CMakeLists.txt    2011-02-24 18:43:30.818529179 +0800
121
121
@@ -0,0 +1,38 @@
122
122
+project (unity-window-decorator)
123
123
+
157
157
+compiz_package_generation ("Compiz Unity Window Decorator")
158
158
+
159
159
+
160
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/COPYING
 
160
Index: compiz-0.9.4/unity/unity_window_decorator/COPYING
161
161
===================================================================
162
162
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
163
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/COPYING   2011-01-19 16:49:57.754695001 +0100
 
163
+++ compiz-0.9.4/unity/unity_window_decorator/COPYING   2011-02-24 18:43:30.818529179 +0800
164
164
@@ -0,0 +1,6 @@
165
165
+Most of the code is MIT licensed, some code is instead licensed
166
166
+under the LGPL and some under the GPL. Each source code file
168
168
+specific file.
169
169
+
170
170
+For More information see COPYING.GPL, COPYING.LGPL and COPYING.MIT.
171
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/COPYING.GPL
 
171
Index: compiz-0.9.4/unity/unity_window_decorator/COPYING.GPL
172
172
===================================================================
173
173
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
174
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/COPYING.GPL       2011-01-19 16:49:57.754695001 +0100
 
174
+++ compiz-0.9.4/unity/unity_window_decorator/COPYING.GPL       2011-02-24 18:43:30.818529179 +0800
175
175
@@ -0,0 +1,340 @@
176
176
+                   GNU GENERAL PUBLIC LICENSE
177
177
+                      Version 2, June 1991
513
513
+consider it more useful to permit linking proprietary applications with the
514
514
+library.  If this is what you want to do, use the GNU Library General
515
515
+Public License instead of this License.
516
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/INSTALL
 
516
Index: compiz-0.9.4/unity/unity_window_decorator/INSTALL
517
517
===================================================================
518
518
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
519
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/INSTALL   2011-01-19 16:49:57.754695001 +0100
 
519
+++ compiz-0.9.4/unity/unity_window_decorator/INSTALL   2011-02-24 18:43:30.828529191 +0800
520
520
@@ -0,0 +1,14 @@
521
521
+compiz uses libstartup-notification which is available at
522
522
+ftp://ftp.gnome.org/pub/GNOME/sources/startup-notification/
532
532
+       $ make
533
533
+       # make install
534
534
+
535
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/README
 
535
Index: compiz-0.9.4/unity/unity_window_decorator/README
536
536
===================================================================
537
537
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
538
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/README    2011-01-19 16:49:57.758695001 +0100
 
538
+++ compiz-0.9.4/unity/unity_window_decorator/README    2011-02-24 18:43:30.828529191 +0800
539
539
@@ -0,0 +1,8 @@
540
540
+compiz - OpenGL window and compositing manager
541
541
+
545
545
+
546
546
+David Reveman
547
547
+davidr@novell.com
548
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/CMakeLists.txt
 
548
Index: compiz-0.9.4/unity/unity_window_decorator/src/CMakeLists.txt
549
549
===================================================================
550
550
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
551
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/CMakeLists.txt        2011-01-19 16:50:35.526695000 +0100
 
551
+++ compiz-0.9.4/unity/unity_window_decorator/src/CMakeLists.txt        2011-02-24 18:43:30.828529191 +0800
552
552
@@ -0,0 +1,161 @@
553
553
+function (compiz_install_gconf_schema _src _dst)
554
554
+    pkg_check_modules (GCONF gconf-2.0)
711
711
+
712
712
+
713
713
+
714
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/TODO
 
714
Index: compiz-0.9.4/unity/unity_window_decorator/src/TODO
715
715
===================================================================
716
716
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
717
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/TODO  2011-01-19 16:49:57.758695001 +0100
 
717
+++ compiz-0.9.4/unity/unity_window_decorator/src/TODO  2011-02-24 18:43:31.000000000 +0800
718
718
@@ -0,0 +1,6 @@
719
719
+
720
720
+* Plugin interface
722
722
+* Plugin with SVG-based theme support
723
723
+
724
724
+* Plugin that supports old metacity themes
725
 
\ Pas de fin de ligne ? la fin du fichier.
726
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/actionmenu.c
 
725
\ No newline at end of file
 
726
Index: compiz-0.9.4/unity/unity_window_decorator/src/actionmenu.c
727
727
===================================================================
728
728
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
729
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/actionmenu.c  2011-01-19 16:49:57.758695001 +0100
 
729
+++ compiz-0.9.4/unity/unity_window_decorator/src/actionmenu.c  2011-02-24 18:43:31.000000000 +0800
730
730
@@ -0,0 +1,109 @@
731
731
+#include "gtk-window-decorator.h"
732
732
+
837
837
+
838
838
+    action_menu_mapped = TRUE;
839
839
+}
840
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/blurprops.c
 
840
Index: compiz-0.9.4/unity/unity_window_decorator/src/blurprops.c
841
841
===================================================================
842
842
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
843
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/blurprops.c   2011-01-19 16:49:57.758695001 +0100
 
843
+++ compiz-0.9.4/unity/unity_window_decorator/src/blurprops.c   2011-02-24 18:43:31.000000000 +0800
844
844
@@ -0,0 +1,68 @@
845
845
+#include "gtk-window-decorator.h"
846
846
+
910
910
+       gdk_error_trap_pop ();
911
911
+    }
912
912
+}
913
 
\ Pas de fin de ligne ? la fin du fichier.
914
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/cairo.c
 
913
\ No newline at end of file
 
914
Index: compiz-0.9.4/unity/unity_window_decorator/src/cairo.c
915
915
===================================================================
916
916
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
917
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/cairo.c       2011-01-19 16:49:57.766695001 +0100
 
917
+++ compiz-0.9.4/unity/unity_window_decorator/src/cairo.c       2011-02-24 18:43:31.000000000 +0800
918
918
@@ -0,0 +1,1001 @@
919
919
+#include "gtk-window-decorator.h"
920
920
+
1903
1903
+                                       TRANSLUCENT_CORNER_SIZE,
1904
1904
+                                       _max_win_extents.bottom - TRANSLUCENT_CORNER_SIZE,
1905
1905
+                                       &opt_inactive_shadow,
1906
 
+                                       &max_window_active_context,
 
1906
+                                       &max_window_inactive_context,
1907
1907
+                                       draw_border_shape,
1908
1908
+                                       (void *) 1);
1909
1909
+       default:
1917
1917
+get_shadow (decor_t *d, gint shadow_type)
1918
1918
+{
1919
1919
+}
1920
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/config.h.gtk.in
 
1920
Index: compiz-0.9.4/unity/unity_window_decorator/src/config.h.gtk.in
1921
1921
===================================================================
1922
1922
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
1923
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/config.h.gtk.in       2011-01-19 16:49:57.766695001 +0100
 
1923
+++ compiz-0.9.4/unity/unity_window_decorator/src/config.h.gtk.in       2011-02-24 18:43:31.000000000 +0800
1924
1924
@@ -0,0 +1,25 @@
1925
1925
+/* Define to 1 if Metacity support is enabled */
1926
1926
+#cmakedefine USE_METACITY 1
1947
1947
+#cmakedefine HAVE_METACITY_2_23_2 1
1948
1948
+
1949
1949
+#define GETTEXT_PACKAGE "${GETTEXT_PACKAGE}"
1950
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/decorator.c
 
1950
Index: compiz-0.9.4/unity/unity_window_decorator/src/decorator.c
1951
1951
===================================================================
1952
1952
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
1953
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/decorator.c   2011-01-19 16:49:57.770695001 +0100
1954
 
@@ -0,0 +1,882 @@
 
1953
+++ compiz-0.9.4/unity/unity_window_decorator/src/decorator.c   2011-02-24 18:43:31.000000000 +0800
 
1954
@@ -0,0 +1,870 @@
1955
1955
+#include "gtk-window-decorator.h"
1956
1956
+
1957
1957
+static const PangoFontDescription *
2608
2608
+       update_window_decoration_size (win);
2609
2609
+       update_event_windows (win);
2610
2610
+    }
2611
 
+    else
2612
 
+    {
2613
 
+       Window xid = wnck_window_get_xid (win);
2614
 
+       Window select;
2615
 
+
2616
 
+       if (get_window_prop (xid, select_window_atom, &select))
2617
 
+       {
2618
 
+           /* force size update */
2619
 
+           d->context = NULL;
2620
 
+           d->width = d->height = 0;
2621
 
+           switcher_width = switcher_height = 0;
2622
 
+
2623
 
+           update_switcher_window (win, select);
2624
 
+       }
2625
 
+    }
2626
2611
+}
2627
2612
+
2628
2613
+void
2703
2688
+
2704
2689
+       decor_quads_to_property (data, no_border_shadow->pixmap,
2705
2690
+                                &_shadow_extents, &_shadow_extents,
 
2691
+                                &_shadow_extents, &_shadow_extents,
2706
2692
+                                0, 0, quads, nQuad);
2707
2693
+
2708
2694
+       XChangeProperty (xdisplay, xroot,
2783
2769
+
2784
2770
+       XRenderFreePicture (xdisplay, d.picture);
2785
2771
+
 
2772
+       fprintf (stderr, "extents are %i %i %i %i %i\n", extents.left, extents.right, extents.top, extents.bottom);
 
2773
+
2786
2774
+       decor_quads_to_property (data, GDK_PIXMAP_XID (d.pixmap),
2787
 
+                                &extents, &extents, 0, 0, quads, nQuad);
 
2775
+                                &extents, &extents, &extents, &extents, 0, 0, quads, nQuad);
2788
2776
+
2789
2777
+       XChangeProperty (xdisplay, xroot,
2790
2778
+                        normalAtom,
2811
2799
+       XRenderFreePicture (xdisplay, d.picture);
2812
2800
+
2813
2801
+       decor_quads_to_property (data, GDK_PIXMAP_XID (d.pixmap),
2814
 
+                                &extents, &extents, 0, 0, quads, nQuad);
 
2802
+                                &extents, &extents, &extents, &extents, 0, 0, quads, nQuad);
2815
2803
+
2816
2804
+       XChangeProperty (xdisplay, xroot,
2817
2805
+                        activeAtom,
2834
2822
+    gdk_cairo_set_source_pixmap (d->cr, d->buffer_pixmap, 0, 0);
2835
2823
+    cairo_paint (d->cr);
2836
2824
+}
2837
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/decorprops.c
 
2825
Index: compiz-0.9.4/unity/unity_window_decorator/src/decorprops.c
2838
2826
===================================================================
2839
2827
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
2840
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/decorprops.c  2011-01-19 16:49:57.770695001 +0100
2841
 
@@ -0,0 +1,134 @@
 
2828
+++ compiz-0.9.4/unity/unity_window_decorator/src/decorprops.c  2011-02-24 18:43:31.000000000 +0800
 
2829
@@ -0,0 +1,135 @@
2842
2830
+#include "gtk-window-decorator.h"
2843
2831
+
2844
2832
+void
2877
2865
+    else
2878
2866
+    {
2879
2867
+       decor_quads_to_property (data, GDK_PIXMAP_XID (d->pixmap),
2880
 
+                            &extents, &extents,
 
2868
+                            &extents, &extents, &extents, &extents,
2881
2869
+                            ICON_SPACE + d->button_width,
2882
2870
+                            0,
2883
2871
+                            quads, nQuad);
2952
2940
+    
2953
2941
+    decor_quads_to_property (data, GDK_PIXMAP_XID (d->pixmap),
2954
2942
+                            &_switcher_extents, &_switcher_extents,
 
2943
+                            &_switcher_extents, &_switcher_extents,
2955
2944
+                            0, 0, quads, nQuad);
2956
2945
+    
2957
2946
+    style = gtk_widget_get_style (style_window_rgba);
2973
2962
+    gdk_error_trap_pop ();
2974
2963
+    
2975
2964
+}
2976
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/events.c
 
2965
Index: compiz-0.9.4/unity/unity_window_decorator/src/events.c
2977
2966
===================================================================
2978
2967
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
2979
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/events.c      2011-01-19 16:49:57.774695001 +0100
2980
 
@@ -0,0 +1,1130 @@
 
2968
+++ compiz-0.9.4/unity/unity_window_decorator/src/events.c      2011-02-24 18:43:31.000000000 +0800
 
2969
@@ -0,0 +1,1173 @@
2981
2970
+#include "gtk-window-decorator.h"
2982
2971
+
2983
2972
+void
3836
3825
+    GdkDisplay *gdkdisplay;
3837
3826
+    XEvent     *xevent = gdkxevent;
3838
3827
+    gulong     xid = 0;
 
3828
+    Window     select = 0;
3839
3829
+
3840
3830
+    gdkdisplay = gdk_display_get_default ();
3841
3831
+    xdisplay   = GDK_DISPLAY_XDISPLAY (gdkdisplay);
3842
3832
+
3843
3833
+    switch (xevent->type) {
 
3834
+    case CreateNotify:
 
3835
+       {
 
3836
+           if (!wnck_window_get (xevent->xcreatewindow.window))
 
3837
+           {
 
3838
+               GdkWindow *toplevel = gdk_window_foreign_new_for_display (gdkdisplay,
 
3839
+                                                                         xevent->xcreatewindow.window);
 
3840
+
 
3841
+               if (toplevel)
 
3842
+               {
 
3843
+                   gdk_window_set_events (toplevel,
 
3844
+                                          gdk_window_get_events (toplevel) |
 
3845
+                                          GDK_PROPERTY_CHANGE_MASK);
 
3846
+
 
3847
+                   /* check if the window is a switcher and update accordingly */
 
3848
+
 
3849
+                   if (get_window_prop (xevent->xcreatewindow.window, select_window_atom, &select))
 
3850
+                       update_switcher_window (xevent->xcreatewindow.window, select);
 
3851
+               }
 
3852
+           }
 
3853
+       }
 
3854
+       break;
3844
3855
+    case ButtonPress:
3845
3856
+    case ButtonRelease:
3846
3857
+       xid = (gulong)
3868
3879
+           win = wnck_window_get (xid);
3869
3880
+           if (win)
3870
3881
+           {
3871
 
+               Window frame, window;
 
3882
+               Window frame;
3872
3883
+
3873
 
+               if (!get_window_prop (xid, select_window_atom, &window))
 
3884
+               if (!get_window_prop (xid, select_window_atom, &select))
3874
3885
+               {
3875
3886
+                   if (get_window_prop (xid, frame_input_window_atom, &frame))
3876
3887
+                       add_frame_window (win, frame, FALSE);
3888
3899
+           win = wnck_window_get (xid);
3889
3900
+           if (win)
3890
3901
+           {
3891
 
+               Window frame, window;
 
3902
+               Window frame;
3892
3903
+
3893
 
+               if (!get_window_prop (xid, select_window_atom, &window))
 
3904
+               if (!get_window_prop (xid, select_window_atom, &select))
3894
3905
+               {
3895
3906
+                   if (get_window_prop (xid, frame_output_window_atom, &frame))
3896
3907
+                       add_frame_window (win, frame, TRUE);
3951
3962
+       }
3952
3963
+       else if (xevent->xproperty.atom == select_window_atom)
3953
3964
+       {
3954
 
+           WnckWindow *win;
3955
 
+
3956
 
+           xid = xevent->xproperty.window;
3957
 
+
3958
 
+           win = wnck_window_get (xid);
3959
 
+           if (win)
 
3965
+           Window select;
 
3966
+
 
3967
+           if (get_window_prop (xevent->xproperty.window, select_window_atom, &select))
 
3968
+               update_switcher_window (xevent->xproperty.window, select);
 
3969
+       }
 
3970
+       else if (xevent->xproperty.atom == XA_WM_TRANSIENT_FOR)
 
3971
+       {
 
3972
+           WnckWindow *win = wnck_window_get (xevent->xproperty.window);
 
3973
+
 
3974
+           if (win &&
 
3975
+               wnck_window_get_window_type (win) == WNCK_WINDOW_DIALOG)
3960
3976
+           {
3961
 
+               Window select;
3962
 
+
3963
 
+               if (get_window_prop (xid, select_window_atom, &select))
3964
 
+                   update_switcher_window (win, select);
 
3977
+               Window parent;
 
3978
+
 
3979
+               if (get_window_prop (xevent->xproperty.window, XA_WM_TRANSIENT_FOR, &parent))
 
3980
+               {
 
3981
+                   WnckWindow *p = wnck_window_get (parent);
 
3982
+                   decor_t *d = g_object_get_data (G_OBJECT (p), "decor");
 
3983
+                   decor_t *d_transient = g_object_get_data (G_OBJECT (p), "decor");
 
3984
+
 
3985
+                   if (g_slist_find (d->transient_windows, p))
 
3986
+                       break;
 
3987
+
 
3988
+                   if (d)
 
3989
+                   {
 
3990
+                       d->transient_windows = g_slist_append (d->transient_windows, win);
 
3991
+                       d_transient->transient_parent = p;
 
3992
+                   }
 
3993
+               }
3965
3994
+           }
3966
3995
+       }
3967
3996
+       break;
3968
3997
+    case DestroyNotify:
 
3998
+    {
3969
3999
+       g_hash_table_remove (frame_table,
3970
4000
+                            GINT_TO_POINTER (xevent->xproperty.window));
 
4001
+
3971
4002
+       break;
 
4003
+    }
3972
4004
+    case ClientMessage:
3973
4005
+       if (xevent->xclient.message_type == toolkit_action_atom)
3974
4006
+       {
4108
4140
+
4109
4141
+    return GDK_FILTER_CONTINUE;
4110
4142
+}
4111
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/forcequit.c
 
4143
Index: compiz-0.9.4/unity/unity_window_decorator/src/forcequit.c
4112
4144
===================================================================
4113
4145
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
4114
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/forcequit.c   2011-01-19 16:49:57.774695001 +0100
 
4146
+++ compiz-0.9.4/unity/unity_window_decorator/src/forcequit.c   2011-02-24 18:43:31.000000000 +0800
4115
4147
@@ -0,0 +1,176 @@
4116
4148
+#include "gtk-window-decorator.h"
4117
4149
+
4289
4321
+       d->force_quit_dialog = NULL;
4290
4322
+    }
4291
4323
+}
4292
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/gdk.c
 
4324
Index: compiz-0.9.4/unity/unity_window_decorator/src/gdk.c
4293
4325
===================================================================
4294
4326
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
4295
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/gdk.c 2011-01-19 16:49:57.774695001 +0100
 
4327
+++ compiz-0.9.4/unity/unity_window_decorator/src/gdk.c 2011-02-24 18:43:31.000000000 +0800
4296
4328
@@ -0,0 +1,87 @@
4297
4329
+#include "gtk-window-decorator.h"
4298
4330
+
4381
4413
+    window = gtk_widget_get_window (widget);
4382
4414
+    return gdk_pixmap_new (GDK_DRAWABLE (window), w, h, depth);
4383
4415
+}
4384
 
\ Pas de fin de ligne ? la fin du fichier.
4385
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/gtk-window-decorator.c
 
4416
\ No newline at end of file
 
4417
Index: compiz-0.9.4/unity/unity_window_decorator/src/gtk-window-decorator.c
4386
4418
===================================================================
4387
4419
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
4388
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/gtk-window-decorator.c        2011-01-19 16:49:57.778695001 +0100
4389
 
@@ -0,0 +1,414 @@
 
4420
+++ compiz-0.9.4/unity/unity_window_decorator/src/gtk-window-decorator.c        2011-02-24 18:43:31.000000000 +0800
 
4421
@@ -0,0 +1,443 @@
4390
4422
+/*
4391
4423
+ * Copyright © 2006 Novell, Inc.
4392
4424
+ *
4570
4602
+gint      switcher_width;
4571
4603
+gint      switcher_height;
4572
4604
+Window    switcher_selected_window = None;
 
4605
+decor_t   *switcher_window = NULL;
4573
4606
+
4574
4607
+XRenderPictFormat *xformat_rgba;
4575
4608
+XRenderPictFormat *xformat_rgb;
4582
4615
+    GdkScreen  *gdkscreen;
4583
4616
+    WnckScreen *screen;
4584
4617
+    gint       i, j, status;
 
4618
+    unsigned int nchildren;
 
4619
+    Window     root_ret, parent_ret;
 
4620
+    Window     *children = NULL;
4585
4621
+    gboolean   replace = FALSE;
4586
4622
+
4587
4623
+#ifdef USE_METACITY
4778
4814
+
4779
4815
+    if (!minimal)
4780
4816
+    {
 
4817
+       GdkWindow *root = gdk_window_foreign_new_for_display (gdkdisplay,
 
4818
+                                                             gdk_x11_get_default_root_xwindow ());
 
4819
+
4781
4820
+       gdk_window_add_filter (NULL,
4782
4821
+                              event_filter_func,
4783
4822
+                              NULL);
 
4823
+                              
 
4824
+       XQueryTree (xdisplay, gdk_x11_get_default_root_xwindow (),
 
4825
+                   &root_ret, &parent_ret, &children, &nchildren);
 
4826
+
 
4827
+       for (i = 0; i < nchildren; i++)
 
4828
+       {
 
4829
+           GdkWindow *toplevel = gdk_window_foreign_new_for_display (gdkdisplay,
 
4830
+                                                                     children[i]);
 
4831
+
 
4832
+           /* Need property notify on all windows */
 
4833
+
 
4834
+           gdk_window_set_events (toplevel,
 
4835
+                                  gdk_window_get_events (toplevel) |
 
4836
+                                  GDK_PROPERTY_CHANGE_MASK);
 
4837
+       }
 
4838
+
 
4839
+       /* Need MapNotify on new windows */
 
4840
+       gdk_window_set_events (root, gdk_window_get_events (root) |
 
4841
+                              GDK_STRUCTURE_MASK |
 
4842
+                              GDK_PROPERTY_CHANGE_MASK |
 
4843
+                              GDK_VISIBILITY_NOTIFY_MASK |
 
4844
+                              GDK_SUBSTRUCTURE_MASK);
4784
4845
+
4785
4846
+       connect_screen (screen);
4786
4847
+    }
4801
4862
+
4802
4863
+    return 0;
4803
4864
+}
4804
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/gtk-window-decorator.h
 
4865
Index: compiz-0.9.4/unity/unity_window_decorator/src/gtk-window-decorator.h
4805
4866
===================================================================
4806
4867
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
4807
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/gtk-window-decorator.h        2011-01-19 16:49:57.778695001 +0100
4808
 
@@ -0,0 +1,969 @@
 
4868
+++ compiz-0.9.4/unity/unity_window_decorator/src/gtk-window-decorator.h        2011-02-24 18:43:31.000000000 +0800
 
4869
@@ -0,0 +1,980 @@
4809
4870
+#ifndef _GTK_WINDOW_DECORATOR_H
4810
4871
+#define _GTK_WINDOW_DECORATOR_H
4811
4872
+#ifdef HAVE_CONFIG_H
4830
4891
+
4831
4892
+#include <gtk/gtk.h>
4832
4893
+#include <gdk/gdkx.h>
 
4894
+#include <gdk/gdk.h>
4833
4895
+
4834
4896
+#ifdef USE_GCONF_UNITY_WINDOW_DECORATOR
4835
4897
+#include <gconf/gconf-client.h>
5203
5265
+    WnckWindowActions actions;
5204
5266
+    XID                      prop_xid;
5205
5267
+    GtkWidget        *force_quit_dialog;
 
5268
+    GSList           *transient_windows;
 
5269
+    WnckWindow       *transient_parent;
5206
5270
+    Bool             created;
5207
5271
+    void             (*draw) (struct _decor *d);
5208
5272
+} decor_t;
5269
5333
+extern gint      switcher_width;
5270
5334
+extern gint      switcher_height;
5271
5335
+extern Window    switcher_selected_window;
 
5336
+extern decor_t   *switcher_window;
5272
5337
+
5273
5338
+extern XRenderPictFormat *xformat_rgba;
5274
5339
+extern XRenderPictFormat *xformat_rgb;
5359
5424
+restack_window (WnckWindow *win,
5360
5425
+               int        stack_mode);
5361
5426
+
 
5427
+void connect_window (WnckWindow *win);
5362
5428
+
5363
5429
+/* blur.c */
5364
5430
+
5558
5624
+draw_switcher_decoration (decor_t *d);
5559
5625
+
5560
5626
+gboolean
5561
 
+update_switcher_window (WnckWindow *win,
 
5627
+update_switcher_window (Window            popup,
5562
5628
+                       Window     selected);
5563
5629
+
 
5630
+decor_t *
 
5631
+switcher_window_opened (Window popup, Window selected);
 
5632
+
 
5633
+void
 
5634
+switcher_window_closed ();
 
5635
+
5564
5636
+/* events.c */
5565
5637
+
5566
5638
+void
5775
5847
+init_settings (WnckScreen *screen);
5776
5848
+
5777
5849
+#endif
5778
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/gwd.schemas.in
 
5850
Index: compiz-0.9.4/unity/unity_window_decorator/src/gwd.schemas.in
5779
5851
===================================================================
5780
5852
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
5781
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/gwd.schemas.in        2011-01-19 16:49:57.778695001 +0100
 
5853
+++ compiz-0.9.4/unity/unity_window_decorator/src/gwd.schemas.in        2011-02-24 18:43:31.000000000 +0800
5782
5854
@@ -0,0 +1,81 @@
5783
5855
+<gconfschemafile>
5784
5856
+    <schemalist>
5861
5933
+        </schema>
5862
5934
+    </schemalist>  
5863
5935
+</gconfschemafile>
5864
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/metacity.c
 
5936
Index: compiz-0.9.4/unity/unity_window_decorator/src/metacity.c
5865
5937
===================================================================
5866
5938
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
5867
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/metacity.c    2011-01-19 16:49:57.782695001 +0100
5868
 
@@ -0,0 +1,1898 @@
 
5939
+++ compiz-0.9.4/unity/unity_window_decorator/src/metacity.c    2011-02-24 18:43:31.000000000 +0800
 
5940
@@ -0,0 +1,1923 @@
5869
5941
+#include "gtk-window-decorator.h"
5870
5942
+
5871
5943
+#ifdef USE_METACITY
5891
5963
+    Display        *xdisplay =
5892
5964
+       GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
5893
5965
+    gint           nQuad;
5894
 
+    decor_extents_t extents, max_extents;
 
5966
+    decor_extents_t extents, max_extents, frame_extents, frame_max_extents;
5895
5967
+    decor_quad_t    quads[N_QUADS_MAX];
5896
5968
+    gint            w, lh, rh;
5897
5969
+    gint           top_stretch_offset;
5929
6001
+                                            top_stretch_offset,
5930
6002
+                                            bottom_stretch_offset);
5931
6003
+
5932
 
+    extents = _win_extents;
5933
 
+    max_extents = _max_win_extents;
 
6004
+    extents = frame_extents = _win_extents;
 
6005
+    max_extents = frame_max_extents = _max_win_extents;
5934
6006
+
5935
6007
+    /* Add the invisible grab area padding, but only for
5936
6008
+     * pixmap type decorations */
5944
6016
+
5945
6017
+    if (!d->frame_window && invisible_grab_area_properties)
5946
6018
+    {
5947
 
+       extents.left += invisible_grab_area_properties->left;
5948
 
+       extents.right += invisible_grab_area_properties->right;
5949
 
+       extents.bottom += invisible_grab_area_properties->bottom;
 
6019
+       frame_extents.left += invisible_grab_area_properties->left;
 
6020
+       frame_extents.right += invisible_grab_area_properties->right;
 
6021
+       frame_extents.bottom += invisible_grab_area_properties->bottom;
5950
6022
+    }
5951
6023
+
5952
6024
+    extents.top += titlebar_height;
 
6025
+    frame_extents.top += titlebar_height;
5953
6026
+    max_extents.top += max_titlebar_height;
 
6027
+    frame_max_extents.top += max_titlebar_height;
5954
6028
+
5955
6029
+    if (d->frame_window)
5956
6030
+       decor_gen_window_property (data, &extents, &max_extents, 20, 20);
5957
6031
+    else
5958
6032
+       decor_quads_to_property (data, GDK_PIXMAP_XID (d->pixmap),
5959
 
+                                &extents, &max_extents,
 
6033
+                                &frame_extents, &extents, &frame_max_extents, &max_extents,
5960
6034
+                                ICON_SPACE + d->button_width,
5961
6035
+                                0,
5962
6036
+                                quads, nQuad);
6350
6424
+
6351
6425
+    if (d->active)
6352
6426
+       *flags |= (MetaFrameFlags ) META_FRAME_HAS_FOCUS;
 
6427
+    else if (g_slist_length (d->transient_windows) > 1)
 
6428
+    {
 
6429
+       GSList  *transient_windows = d->transient_windows;
 
6430
+
 
6431
+       for (; transient_windows;
 
6432
+            transient_windows = transient_windows->next)
 
6433
+       {
 
6434
+           if (!transient_windows->data)
 
6435
+               continue;
 
6436
+
 
6437
+           decor_t *d_transient = g_object_get_data (transient_windows->data, "decor");
 
6438
+
 
6439
+           if (d_transient)
 
6440
+           {
 
6441
+               if (d_transient->active)
 
6442
+               {
 
6443
+                   *flags |= (MetaFrameFlags ) META_FRAME_HAS_FOCUS;
 
6444
+                   break;
 
6445
+               }
 
6446
+           }
 
6447
+       }
 
6448
+    }
6353
6449
+
6354
6450
+    if ((d->state & META_MAXIMIZED) == META_MAXIMIZED)
6355
6451
+       *flags |= (MetaFrameFlags ) META_FRAME_MAXIMIZED;
6858
6954
+    frame_style = meta_theme_get_frame_style (theme, META_FRAME_TYPE_NORMAL, flags);
6859
6955
+
6860
6956
+    if (!frame_style)
6861
 
+       return;
 
6957
+       return FALSE;
6862
6958
+
6863
6959
+    invisible_grab_area_properties =
6864
6960
+        meta_frame_style_get_invisible_grab_area_properties (frame_style);
7190
7286
+       switch (j) {
7191
7287
+       case 2: /* right */
7192
7288
+           *x = width - fgeom.right_width;
 
7289
+           *y = fgeom.top_height + RESIZE_EXTENDS; 
7193
7290
+           if (d->frame_window)
7194
7291
+               *x += _win_extents.left + 2;
7195
7292
+           *w = fgeom.right_width;
7747
7844
+                                       TRANSLUCENT_CORNER_SIZE,
7748
7845
+                                       _max_win_extents.bottom - TRANSLUCENT_CORNER_SIZE,
7749
7846
+                                       &opt_shadow,
7750
 
+                                       &max_window_active_context,
 
7847
+                                       &max_window_inactive_context,
7751
7848
+                                       draw_border_shape,
7752
7849
+                                       (void *) 1);
7753
7850
+       default:
7764
7861
+
7765
7862
+
7766
7863
+#endif
7767
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/settings.c
 
7864
Index: compiz-0.9.4/unity/unity_window_decorator/src/settings.c
7768
7865
===================================================================
7769
7866
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
7770
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/settings.c    2011-01-19 16:49:57.782695001 +0100
 
7867
+++ compiz-0.9.4/unity/unity_window_decorator/src/settings.c    2011-02-24 18:43:31.000000000 +0800
7771
7868
@@ -0,0 +1,564 @@
7772
7869
+#include "gtk-window-decorator.h"
7773
7870
+
8333
8430
+
8334
8431
+    return TRUE;
8335
8432
+}
8336
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/style.c
 
8433
Index: compiz-0.9.4/unity/unity_window_decorator/src/style.c
8337
8434
===================================================================
8338
8435
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
8339
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/style.c       2011-01-19 16:49:57.782695001 +0100
 
8436
+++ compiz-0.9.4/unity/unity_window_decorator/src/style.c       2011-02-24 18:43:31.000000000 +0800
8340
8437
@@ -0,0 +1,42 @@
8341
8438
+#include "gtk-window-decorator.h"
8342
8439
+
8380
8477
+
8381
8478
+    decorations_changed (screen);
8382
8479
+}
8383
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/switcher.c
 
8480
Index: compiz-0.9.4/unity/unity_window_decorator/src/switcher.c
8384
8481
===================================================================
8385
8482
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
8386
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/switcher.c    2011-01-19 16:49:57.782695001 +0100
8387
 
@@ -0,0 +1,427 @@
 
8483
+++ compiz-0.9.4/unity/unity_window_decorator/src/switcher.c    2011-02-24 18:43:31.000000000 +0800
 
8484
@@ -0,0 +1,455 @@
8388
8485
+#include "gtk-window-decorator.h"
8389
8486
+
8390
8487
+static void
8644
8741
+    draw_switcher_foreground (d);
8645
8742
+}
8646
8743
+
 
8744
+void
 
8745
+switcher_window_closed ()
 
8746
+{
 
8747
+    g_free (switcher_window);
 
8748
+    switcher_window = NULL;
 
8749
+}
 
8750
+
 
8751
+/* Switcher is override-redirect now, we need to track
 
8752
+ * it separately */
 
8753
+decor_t *
 
8754
+switcher_window_opened (Window popup, Window window)
 
8755
+{
 
8756
+    decor_t      *d;
 
8757
+
 
8758
+    d = switcher_window = calloc (1, sizeof (decor_t));
 
8759
+    if (!d)
 
8760
+       return NULL;
 
8761
+
 
8762
+    return d;
 
8763
+}
 
8764
+
8647
8765
+gboolean
8648
 
+update_switcher_window (WnckWindow *win,
 
8766
+update_switcher_window (Window    popup,
8649
8767
+                       Window     selected)
8650
8768
+{
8651
 
+    decor_t           *d = g_object_get_data (G_OBJECT (win), "decor");
 
8769
+    decor_t           *d = switcher_window;
8652
8770
+    GdkPixmap         *pixmap, *buffer_pixmap = NULL;
8653
 
+    gint              height, width = 0;
 
8771
+    unsigned int      height, width = 0, border, depth;
 
8772
+    int                      x, y;
 
8773
+    Window           root_return;
8654
8774
+    WnckWindow        *selected_win;
8655
8775
+    Display           *xdisplay;
8656
8776
+    XRenderPictFormat *format;
8657
8777
+
 
8778
+    if (!d)
 
8779
+       d = switcher_window_opened (popup, selected);
 
8780
+
8658
8781
+    xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
8659
8782
+
8660
 
+    wnck_window_get_client_window_geometry (win, NULL, NULL, &width, NULL);
 
8783
+    /* Thats a round-trip */
 
8784
+    XGetGeometry (gdk_x11_get_default_xdisplay (), popup, &root_return,
 
8785
+                 &x, &y, &width, &height, &border, &depth);
8661
8786
+
8662
8787
+    decor_get_default_layout (&switcher_context, width, 1, &d->border_layout);
8663
8788
+
8806
8931
+    d->width  = width;
8807
8932
+    d->height = height;
8808
8933
+
8809
 
+    d->prop_xid = wnck_window_get_xid (win);
 
8934
+    d->prop_xid = popup;
8810
8935
+
8811
8936
+    queue_decor_draw (d);
8812
8937
+
8813
8938
+    return TRUE;
8814
8939
+}
8815
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/util.c
 
8940
Index: compiz-0.9.4/unity/unity_window_decorator/src/util.c
8816
8941
===================================================================
8817
8942
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
8818
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/util.c        2011-01-19 16:49:57.786695001 +0100
 
8943
+++ compiz-0.9.4/unity/unity_window_decorator/src/util.c        2011-02-24 18:43:31.000000000 +0800
8819
8944
@@ -0,0 +1,278 @@
8820
8945
+#include "gtk-window-decorator.h"
8821
8946
+
9095
9220
+    b->b = blue;
9096
9221
+}
9097
9222
+
9098
 
Index: compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/wnck.c
 
9223
Index: compiz-0.9.4/unity/unity_window_decorator/src/wnck.c
9099
9224
===================================================================
9100
9225
--- /dev/null   1970-01-01 00:00:00.000000000 +0000
9101
 
+++ compiz-0.9.2.1+glibmainloop4/unity/unity_window_decorator/src/wnck.c        2011-01-19 16:49:57.786695001 +0100
9102
 
@@ -0,0 +1,687 @@
 
9226
+++ compiz-0.9.4/unity/unity_window_decorator/src/wnck.c        2011-02-24 18:43:31.000000000 +0800
 
9227
@@ -0,0 +1,758 @@
9103
9228
+#include "gtk-window-decorator.h"
9104
9229
+
9105
9230
+static void
9185
9310
+    GdkDisplay *gdkdisplay;
9186
9311
+    GdkScreen  *gdkscreen;
9187
9312
+    GList      *windows;
 
9313
+    Window select;
9188
9314
+
9189
9315
+    gdkdisplay = gdk_display_get_default ();
9190
9316
+    gdkscreen  = gdk_display_get_default_screen (gdkdisplay);
9198
9324
+    if (minimal)
9199
9325
+       return;
9200
9326
+
 
9327
+    /* Update all normal windows */
 
9328
+
9201
9329
+    windows = wnck_screen_get_windows (screen);
9202
9330
+    while (windows != NULL)
9203
9331
+    {
9217
9345
+       update_window_decoration (WNCK_WINDOW (windows->data));
9218
9346
+       windows = windows->next;
9219
9347
+    }
 
9348
+
 
9349
+    /* Update switcher window */
 
9350
+
 
9351
+    if (switcher_window &&
 
9352
+       get_window_prop (switcher_window->prop_xid,
 
9353
+                        select_window_atom, &select))
 
9354
+    {
 
9355
+       decor_t *d = switcher_window;
 
9356
+       /* force size update */
 
9357
+       d->context = NULL;
 
9358
+       d->width = d->height = 0;
 
9359
+       switcher_width = switcher_height = 0;
 
9360
+
 
9361
+       update_switcher_window (d->prop_xid, select);
 
9362
+    }
9220
9363
+}
9221
9364
+
9222
9365
+void
9540
9683
+    draw_list = g_slist_remove (draw_list, d);
9541
9684
+}
9542
9685
+
9543
 
+static void
 
9686
+void
9544
9687
+connect_window (WnckWindow *win)
9545
9688
+{
9546
9689
+    g_signal_connect_object (win, "name_changed",
9615
9758
+               }
9616
9759
+           }
9617
9760
+
9618
 
+
9619
 
+           update_window_decoration_size (d->win);
 
9761
+           /* We need to update the decoration size here
 
9762
+            * since the shadow size might have changed and
 
9763
+            * in that case the decoration will be redrawn,
 
9764
+            * however if the shadow size doesn't change
 
9765
+            * then we need to redraw the decoration anyways
 
9766
+            * since the image would have changed */
 
9767
+           if (!update_window_decoration_size (d->win))
 
9768
+               queue_decor_draw (d);
 
9769
+
 
9770
+           /* Also update any parents of this window
 
9771
+            * since they won't get a notification here
 
9772
+            */
 
9773
+           if (d->transient_parent)
 
9774
+           {
 
9775
+               decor_t *d_parent = g_object_get_data (d->transient_parent, "decor");
 
9776
+               queue_decor_draw (d_parent);
 
9777
+           }
 
9778
+
9620
9779
+       }
9621
9780
+    }
9622
9781
+
9627
9786
+       if (d && d->pixmap)
9628
9787
+       {
9629
9788
+           d->active = wnck_window_is_active (win);
9630
 
+           queue_decor_draw (d);
9631
 
+       }
9632
 
+
9633
 
+       if ((d->state & META_MAXIMIZED) == META_MAXIMIZED)
9634
 
+       {
9635
 
+           if (!d->frame_window)
9636
 
+           {
9637
 
+               if (d->active)
9638
 
+               {
9639
 
+                   d->context = &max_window_active_context;
9640
 
+                   d->shadow  = max_border_active_shadow;
9641
 
+               }
9642
 
+               else
9643
 
+               {
9644
 
+                   d->context = &max_window_inactive_context;
9645
 
+                   d->shadow  = max_border_inactive_shadow;
9646
 
+               }
9647
 
+           }
9648
 
+           else
9649
 
+           {
9650
 
+               d->shadow  = max_border_no_shadow;
9651
 
+           }
9652
 
+       }
9653
 
+       else
9654
 
+       {
9655
 
+           if (!d->frame_window)
9656
 
+           {
9657
 
+               if (d->active)
9658
 
+               {
9659
 
+                   d->context = &window_active_context;
9660
 
+                   d->shadow  = border_active_shadow;
9661
 
+               }
9662
 
+               else
9663
 
+               {
9664
 
+                   d->context = &window_inactive_context;
9665
 
+                   d->shadow  = border_inactive_shadow;
9666
 
+               }
9667
 
+           }
9668
 
+           else
9669
 
+           {
9670
 
+               d->shadow  = border_no_shadow;
9671
 
+           }
9672
 
+       }
9673
 
+
9674
 
+       update_window_decoration_size (d->win);
 
9789
+
 
9790
+           if ((d->state & META_MAXIMIZED) == META_MAXIMIZED)
 
9791
+           {
 
9792
+               if (!d->frame_window)
 
9793
+               {
 
9794
+                   if (d->active)
 
9795
+                   {
 
9796
+                       d->context = &max_window_active_context;
 
9797
+                       d->shadow  = max_border_active_shadow;
 
9798
+                   }
 
9799
+                   else
 
9800
+                   {
 
9801
+                       d->context = &max_window_inactive_context;
 
9802
+                       d->shadow  = max_border_inactive_shadow;
 
9803
+                   }
 
9804
+               }
 
9805
+               else
 
9806
+               {
 
9807
+                   d->shadow  = max_border_no_shadow;
 
9808
+               }
 
9809
+           }
 
9810
+           else
 
9811
+           {
 
9812
+               if (!d->frame_window)
 
9813
+               {
 
9814
+                   if (d->active)
 
9815
+                   {
 
9816
+                       d->context = &window_active_context;
 
9817
+                       d->shadow  = border_active_shadow;
 
9818
+                   }
 
9819
+                   else
 
9820
+                   {
 
9821
+                       d->context = &window_inactive_context;
 
9822
+                       d->shadow  = border_inactive_shadow;
 
9823
+                   }
 
9824
+               }
 
9825
+               else
 
9826
+               {
 
9827
+                   d->shadow  = border_no_shadow;
 
9828
+               }
 
9829
+           }
 
9830
+
 
9831
+           /* We need to update the decoration size here
 
9832
+            * since the shadow size might have changed and
 
9833
+            * in that case the decoration will be redrawn,
 
9834
+            * however if the shadow size doesn't change
 
9835
+            * then we need to redraw the decoration anyways
 
9836
+            * since the image would have changed */
 
9837
+           if (!update_window_decoration_size (d->win))
 
9838
+               queue_decor_draw (d);
 
9839
+
 
9840
+           /* Also update any parents of this window
 
9841
+            * since they won't get a notification here
 
9842
+            */
 
9843
+           if (d->transient_parent)
 
9844
+           {
 
9845
+               decor_t *d_parent = g_object_get_data (d->transient_parent, "decor");
 
9846
+               queue_decor_draw (d_parent);
 
9847
+           }
 
9848
+       }
9675
9849
+    }
9676
9850
+}
9677
9851
+
9724
9898
+    d->cr = NULL;
9725
9899
+    d->buffer_pixmap = NULL;
9726
9900
+    d->picture = None;
 
9901
+    d->transient_windows = g_slist_alloc ();
9727
9902
+
9728
9903
+    connect_window (win);
9729
9904
+
9731
9906
+
9732
9907
+    xid = wnck_window_get_xid (win);
9733
9908
+
9734
 
+    if (get_window_prop (xid, select_window_atom, &window))
9735
 
+    {
9736
 
+       d->prop_xid = wnck_window_get_xid (win);
9737
 
+       update_switcher_window (win, window);
9738
 
+    }
9739
 
+    else if (get_window_prop (xid, frame_input_window_atom, &window))
 
9909
+    if (get_window_prop (xid, frame_input_window_atom, &window))
9740
9910
+    {
9741
9911
+       add_frame_window (win, window, FALSE);
9742
9912
+    }
9744
9914
+    {
9745
9915
+       add_frame_window (win, window, TRUE);
9746
9916
+    }
 
9917
+
 
9918
+    if (wnck_window_get_window_type (win) == WNCK_WINDOW_DIALOG)
 
9919
+    {
 
9920
+       Window parent;
 
9921
+
 
9922
+       if (get_window_prop (xid, XA_WM_TRANSIENT_FOR, &parent))
 
9923
+       {
 
9924
+           WnckWindow *p = wnck_window_get (parent);
 
9925
+           decor_t *d = g_object_get_data (G_OBJECT (p), "decor");
 
9926
+           decor_t *d_transient = g_object_get_data (G_OBJECT (win), "decor");
 
9927
+
 
9928
+           if (d)
 
9929
+           {
 
9930
+               d->transient_windows = g_slist_append (d->transient_windows, win);
 
9931
+               d_transient->transient_parent = p;
 
9932
+           }
 
9933
+       }
 
9934
+    }
9747
9935
+}
9748
9936
+
9749
9937
+static void
9752
9940
+{
9753
9941
+    Display *xdisplay = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
9754
9942
+    decor_t *d = g_object_get_data (G_OBJECT (win), "decor");
 
9943
+    WnckWindow *parent = d->transient_parent;
 
9944
+
 
9945
+    if (parent)
 
9946
+    {
 
9947
+       decor_t *d_parent = g_object_get_data (G_OBJECT (parent), "decor");
 
9948
+
 
9949
+       d_parent->transient_windows = g_slist_remove (d_parent->transient_windows, win);
 
9950
+    }
9755
9951
+
9756
9952
+    remove_frame_window (win);
9757
9953
+