Merge lp:~mkhu/compiz/compiz-fix_gwd_crash_on_activating_actionmenu into lp:compiz/0.9.8

Proposed by Micheal Hsu
Status: Superseded
Proposed branch: lp:~mkhu/compiz/compiz-fix_gwd_crash_on_activating_actionmenu
Merge into: lp:compiz/0.9.8
Diff against target: 17 lines (+5/-2)
1 file modified
gtk/window-decorator/actionmenu.c (+5/-2)
To merge this branch: bzr merge lp:~mkhu/compiz/compiz-fix_gwd_crash_on_activating_actionmenu
Reviewer Review Type Date Requested Status
Daniel van Vugt Needs Resubmitting
Review via email: mp+133013@code.launchpad.net

This proposal has been superseded by a proposal from 2012-11-06.

Description of the change

for an application window without decorations, pressing Alt+Space failed to activate the action menu on the top left corner of the window and also causes the gtk-window-decorator to crash.

the crash is caused by a miscalculation in actionmenu.c: position_action_menu(...)
function (*theme_get_button_position) is not suitable for windows without decorations.
so first we need to check if the window is decorated or not.
most (non-overrided) windows use _MOTIF_WM_HINTS to indicate they're not to be decorated.
thus get_mwm_prop(...) in util.c is quite handy.

NOTE: (*theme_get_button_position) is actually get_button_position(...) in cairo.c

BTW, how to propose merge to both lp:compiz/0.9.8 and lp:compiz/0.9.9 in a single pass

To post a comment you must log in.
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Excellent, thanks.

Please:
1. Log a bug for the crash and link the branch to the bug.
2. Change the indentation to 4 spaces (not tabs except every second level to replace 8-spaces).
3. Propose for merging to lp:compiz only. That's 0.9.9

review: Needs Resubmitting

Unmerged revisions

3412. By hukang <email address hidden>

fix gtk-window-decorator crash when pressing Alt+Space on windows without decorations (e.g. google-chrome)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'gtk/window-decorator/actionmenu.c'
2--- gtk/window-decorator/actionmenu.c 2011-05-07 08:58:10 +0000
3+++ gtk/window-decorator/actionmenu.c 2012-11-06 06:42:21 +0000
4@@ -41,9 +41,12 @@
5
6 wnck_window_get_client_window_geometry (win, x, y, &width, &height);
7
8- if ((*theme_get_button_position) (d, BUTTON_MENU, width, height,
9+ if (get_mwm_prop (wnck_window_get_xid (win)))
10+ {
11+ if ((*theme_get_button_position) (d, BUTTON_MENU, width, height,
12 &bx, &by, &width, &height))
13- *x = *x - frame->win_extents.left + bx;
14+ *x = *x - frame->win_extents.left + bx;
15+ }
16
17 gwd_decor_frame_unref (frame);
18

Subscribers

People subscribed via source and target branches