Skip to content

Commit

Permalink
fix closing sidebar on click outside
Browse files Browse the repository at this point in the history
  • Loading branch information
bobufa committed Aug 13, 2018
1 parent dfc7d2a commit b0c9464
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main/src/ui/unified_window.vala
Expand Up @@ -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) {
Expand Down

0 comments on commit b0c9464

Please sign in to comment.