diff options
author | bobufa <bobufa@users.noreply.github.com> | 2018-08-08 11:35:41 +0200 |
---|---|---|
committer | bobufa <bobufa@users.noreply.github.com> | 2018-08-13 22:39:18 +0200 |
commit | b0c94641fcf85ed55976e894fea970331ae22892 (patch) | |
tree | 9c0ac4a8b87154edb0f622eb379913b6f4f35108 /main/src | |
parent | dfc7d2a890d755bcaf526e586e14046b581ed094 (diff) | |
download | dino-b0c94641fcf85ed55976e894fea970331ae22892.tar.gz dino-b0c94641fcf85ed55976e894fea970331ae22892.zip |
fix closing sidebar on click outside
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/ui/unified_window.vala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/main/src/ui/unified_window.vala b/main/src/ui/unified_window.vala index 97ef7ed4..61a22085 100644 --- a/main/src/ui/unified_window.vala +++ b/main/src/ui/unified_window.vala @@ -70,8 +70,9 @@ public class UnifiedWindow : Gtk.Window { if (event.type == EventType.BUTTON_PRESS) { int dest_x, dest_y; bool ret = search_box.translate_coordinates(this, 0, 0, out dest_x, out dest_y); - print(@"ret $(ret) button-x $(event.button.x_root) !< dest_x $(dest_x)\n"); - if (ret && event.button.x_root < dest_x) { + int geometry_x, geometry_y, geometry_width, geometry_height; + this.get_window().get_geometry(out geometry_x, out geometry_y, out geometry_width, out geometry_height); + if (ret && event.button.x_root - geometry_x < dest_x || event.button.y_root - geometry_y < dest_y) { close_search(); } } else if (event.type == EventType.KEY_RELEASE) { |