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

« back to all changes in this revision

Viewing changes to unity/unity_window_decorator/src/metacity.c

  • 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:
23
23
    Display         *xdisplay =
24
24
        GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
25
25
    gint            nQuad;
26
 
    decor_extents_t extents, max_extents;
 
26
    decor_extents_t extents, max_extents, frame_extents, frame_max_extents;
27
27
    decor_quad_t    quads[N_QUADS_MAX];
28
28
    gint            w, lh, rh;
29
29
    gint            top_stretch_offset;
61
61
                                             top_stretch_offset,
62
62
                                             bottom_stretch_offset);
63
63
 
64
 
    extents = _win_extents;
65
 
    max_extents = _max_win_extents;
 
64
    extents = frame_extents = _win_extents;
 
65
    max_extents = frame_max_extents = _max_win_extents;
66
66
 
67
67
    /* Add the invisible grab area padding, but only for
68
68
     * pixmap type decorations */
76
76
 
77
77
    if (!d->frame_window && invisible_grab_area_properties)
78
78
    {
79
 
        extents.left += invisible_grab_area_properties->left;
80
 
        extents.right += invisible_grab_area_properties->right;
81
 
        extents.bottom += invisible_grab_area_properties->bottom;
 
79
        frame_extents.left += invisible_grab_area_properties->left;
 
80
        frame_extents.right += invisible_grab_area_properties->right;
 
81
        frame_extents.bottom += invisible_grab_area_properties->bottom;
82
82
    }
83
83
 
84
84
    extents.top += titlebar_height;
 
85
    frame_extents.top += titlebar_height;
85
86
    max_extents.top += max_titlebar_height;
 
87
    frame_max_extents.top += max_titlebar_height;
86
88
 
87
89
    if (d->frame_window)
88
90
        decor_gen_window_property (data, &extents, &max_extents, 20, 20);
89
91
    else
90
92
        decor_quads_to_property (data, GDK_PIXMAP_XID (d->pixmap),
91
 
                                 &extents, &max_extents,
 
93
                                 &frame_extents, &extents, &frame_max_extents, &max_extents,
92
94
                                 ICON_SPACE + d->button_width,
93
95
                                 0,
94
96
                                 quads, nQuad);
482
484
 
483
485
    if (d->active)
484
486
        *flags |= (MetaFrameFlags ) META_FRAME_HAS_FOCUS;
 
487
    else if (g_slist_length (d->transient_windows) > 1)
 
488
    {
 
489
        GSList  *transient_windows = d->transient_windows;
 
490
 
 
491
        for (; transient_windows;
 
492
             transient_windows = transient_windows->next)
 
493
        {
 
494
            if (!transient_windows->data)
 
495
                continue;
 
496
 
 
497
            decor_t *d_transient = g_object_get_data (transient_windows->data, "decor");
 
498
 
 
499
            if (d_transient)
 
500
            {
 
501
                if (d_transient->active)
 
502
                {
 
503
                    *flags |= (MetaFrameFlags ) META_FRAME_HAS_FOCUS;
 
504
                    break;
 
505
                }
 
506
            }
 
507
        }
 
508
    }
485
509
 
486
510
    if ((d->state & META_MAXIMIZED) == META_MAXIMIZED)
487
511
        *flags |= (MetaFrameFlags ) META_FRAME_MAXIMIZED;
990
1014
    frame_style = meta_theme_get_frame_style (theme, META_FRAME_TYPE_NORMAL, flags);
991
1015
 
992
1016
    if (!frame_style)
993
 
        return;
 
1017
        return FALSE;
994
1018
 
995
1019
    invisible_grab_area_properties =
996
1020
        meta_frame_style_get_invisible_grab_area_properties (frame_style);
1322
1346
        switch (j) {
1323
1347
        case 2: /* right */
1324
1348
            *x = width - fgeom.right_width;
 
1349
            *y = fgeom.top_height + RESIZE_EXTENDS; 
1325
1350
            if (d->frame_window)
1326
1351
                *x += _win_extents.left + 2;
1327
1352
            *w = fgeom.right_width;