Merge lp:~marcus-lundgren/granite/fix-1062967 into lp:~elementary-pantheon/granite/granite

Proposed by Marcus Lundgren
Status: Merged
Merged at revision: 518
Proposed branch: lp:~marcus-lundgren/granite/fix-1062967
Merge into: lp:~elementary-pantheon/granite/granite
Diff against target: 38 lines (+10/-4)
1 file modified
lib/Widgets/DecoratedWindow.vala (+10/-4)
To merge this branch: bzr merge lp:~marcus-lundgren/granite/fix-1062967
Reviewer Review Type Date Requested Status
Cody Garver (community) Approve
David Gomes (community) Approve
Review via email: mp+143180@code.launchpad.net
To post a comment you must log in.
Revision history for this message
David Gomes (davidgomes) wrote :

if(on_close_button){

if (on_close_button) {

Also, the following looks much better than what you have on line 9.

this.add_events (Gdk.EventMask.BUTTON_PRESS_MASK |
                 Gdk.EventMask.BUTTON_RELEASE_MASK |
                 Gdk.EventMask.POINTER_MOTION_MASK);

Also, please no trailing space like on line 34.

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

Oops, here's the Needs Fixing.

review: Approve
519. By Marcus Lundgren

Code style.

520. By Marcus Lundgren

Trailing whitespace.

Revision history for this message
Cody Garver (codygarver) wrote :

Woohoo!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/Widgets/DecoratedWindow.vala'
2--- lib/Widgets/DecoratedWindow.vala 2012-12-21 00:46:56 +0000
3+++ lib/Widgets/DecoratedWindow.vala 2013-01-14 20:28:19 +0000
4@@ -137,7 +137,9 @@
5 this.box.pack_start (this._title, false);
6 base.add (this.box);
7
8- this.add_events (Gdk.EventMask.BUTTON_PRESS_MASK | Gdk.EventMask.POINTER_MOTION_MASK);
9+ this.add_events (Gdk.EventMask.BUTTON_PRESS_MASK |
10+ Gdk.EventMask.BUTTON_RELEASE_MASK |
11+ Gdk.EventMask.POINTER_MOTION_MASK);
12 this.motion_notify_event.connect (on_motion_notify);
13 this.delete_event.connect_after (on_delete_event);
14 this.size_allocate.connect (on_size_allocate);
15@@ -217,8 +219,6 @@
16
17 public override bool button_press_event (Gdk.EventButton e) {
18 if (coords_over_close_button (e.x, e.y)) {
19- var event = (Gdk.Event*) (&e);
20- this.delete_event (event->any);
21 return true;
22 }
23
24@@ -227,7 +227,13 @@
25 }
26
27 public override bool button_release_event (Gdk.EventButton e) {
28- return coords_over_close_button (e.x, e.y);
29+ bool on_close_button = coords_over_close_button (e.x, e.y);
30+ if(on_close_button) {
31+ var event = (Gdk.Event*) (&e);
32+ this.delete_event (event->any);
33+ }
34+
35+ return on_close_button;
36 }
37
38 private bool coords_over_close_button (double x, double y) {

Subscribers

People subscribed via source and target branches