Commit 6031f8a2 authored by Jens Georg's avatar Jens Georg

Fix double-click maximize artifacts on Wayland

Listen to the double-click on the window contents rather than the whole
window. This makes the maximize functionality work on Wayland as
expected and fixes the screen artifacts.

Fixes #26
parent 7f7aee32
......@@ -218,6 +218,12 @@ public class DirectPhotoPage : EditingHostPage {
fs.close();
return true;
} else {
if (get_container() is DirectWindow) {
(get_container() as DirectWindow).do_fullscreen();
return true;
}
}
return base.on_double_click(event);
......
......@@ -42,6 +42,11 @@ public class DirectWindow : AppWindow {
get_display_pathname(file.get_parent()), Resources.APP_TITLE);
}
// Expose on_fullscreen publicly so we can call it from the DirectPhotoPage
public void do_fullscreen() {
on_fullscreen();
}
protected override void on_fullscreen() {
File file = get_direct_page().get_current_file();
......@@ -74,16 +79,6 @@ public class DirectWindow : AppWindow {
return (base.delete_event != null) ? base.delete_event(event) : false;
}
public override bool button_press_event(Gdk.EventButton event) {
if (event.type == Gdk.EventType.2BUTTON_PRESS) {
on_fullscreen();
return true;
}
return false;
}
public override bool key_press_event(Gdk.EventKey event) {
// check for an escape
if (Gdk.keyval_name(event.keyval) == "Escape") {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment