Merge lp:~adam-davies/granite/fix-1089442 into lp:~elementary-pantheon/granite/granite

Proposed by Adam Davies
Status: Merged
Merged at revision: 517
Proposed branch: lp:~adam-davies/granite/fix-1089442
Merge into: lp:~elementary-pantheon/granite/granite
Diff against target: 17 lines (+7/-0)
1 file modified
lib/Widgets/LightWindow.vala (+7/-0)
To merge this branch: bzr merge lp:~adam-davies/granite/fix-1089442
Reviewer Review Type Date Requested Status
Tom Beckmann (community) Approve
Review via email: mp+141575@code.launchpad.net

Description of the change

Added close-on-escape.

To post a comment you must log in.
Revision history for this message
Tom Beckmann (tombeckmann) wrote :

Maybe it'd be better to derive from GtkDialog instead of GtkWindow. This way we should get the close-on-escape for free and the wm would know better what the purpose of this window is.

review: Needs Fixing
Revision history for this message
David Gomes (davidgomes) wrote :

That's going to be a lot of work Tom. LightWindow inherits CompositedWindow, which can't be a Dialog. DecoratedWindow also can't be a Gtk.Dialog.

So, we'd have to write lots of new code to make LightWindow a Gtk.Dialog, because LightWindow is dependent on DecoratedWindow and CompositedWindow.

Revision history for this message
Tom Beckmann (tombeckmann) wrote :

Apparently it is more work than I expected it to be indeed. Noise is causing trouble as can be read in my merge proposal. So I approve this as a solution that can be considered fine for now.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/Widgets/LightWindow.vala'
2--- lib/Widgets/LightWindow.vala 2012-12-21 00:46:56 +0000
3+++ lib/Widgets/LightWindow.vala 2013-01-01 23:48:20 +0000
4@@ -36,6 +36,13 @@
5 base (title, StyleClass.CONTENT_VIEW_WINDOW, StyleClass.CONTENT_VIEW);
6 }
7
8+ public override bool key_press_event (Gdk.EventKey event) {
9+ if (event.keyval == Gdk.Key.Escape) {
10+ this.delete_event (((Gdk.Event*) (&event))->any);
11+ return true;
12+ }
13+ return base.key_press_event (event);
14+ }
15 }
16
17 }

Subscribers

People subscribed via source and target branches