GNOME Bugzilla – Bug 638674
[PATCH] Allow moving attached dialogs
Last modified: 2011-03-21 21:48:26 UTC
Created attachment 177498 [details] [review] Allow moving attached dialogs This patch allows moving an attached dialog either per ALT+MouseButton1 combo or dragging the title bar. Might close Bug #635557.
Review of attachment 177498 [details] [review]: Code looks good (except for some style suggestions), but the commit message needs improvement: - the subject is misleading - it implies that it allows moving the dialog despite being attached to its parent, rather than using it to move the parent - no body! See http://lists.cairographics.org/archives/cairo/2008-September/015092.html I'd suggest something like: display: Grab attached dialogs' parent Currently, attached modal dialog can be grabbed (either by the title bar, or using Alt+Button1), though they won't move when dragged. To address this, grab the parent in that case, which allows to move both the parent and the attached dialog. ::: src/core/display.c @@ +3551,3 @@ + grab_window = window; + if (meta_prefs_get_attach_modal_dialogs () && Could use a short comment along the lines of /* If window is a modal dialog attached to its parent, grab the parent instead */ @@ +3556,3 @@ + parent = meta_window_get_transient_for (window); + if (parent && parent != window) + grab_window = parent; Maybe a bit more elegant to write this as MetaWindow *grab_window = NULL; ... if (meta_prefs_get_attach_modal_dialogs() && window->type == META_WINDOW_MODAL_DIALOG) grab_window = meta_window_get_transient_for (window); if (grab_window == NULL) grab_window = window;
Review of attachment 177498 [details] [review]: ::: src/core/display.c @@ +3552,3 @@ + grab_window = window; + if (meta_prefs_get_attach_modal_dialogs () && + window->type == META_WINDOW_MODAL_DIALOG) Another issue I noted: changing the grab window to the parent should only be done for move operations - doing it for resizing feels really awkward ...
Pushed with the suggested fixes (as "display: Grab attached dialogs' parent").