Skip to content

Commit

Permalink
Window: put everything in a windowhandle (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit committed Jul 10, 2023
1 parent 0fc50fb commit 972ca33
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 25 deletions.
23 changes: 0 additions & 23 deletions src/Widgets/Player/PlayerPage.vala
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ namespace Audience {
private Gtk.Revealer bottom_bar_revealer;

private uint hiding_timer = 0;
private bool mouse_primary_down = false;

private bool _fullscreened = false;
public bool fullscreened {
Expand Down Expand Up @@ -118,33 +117,11 @@ namespace Audience {
});

event_box.motion_notify_event.connect (event => {
if (mouse_primary_down) {
mouse_primary_down = false;
App.get_instance ().active_window.begin_move_drag (Gdk.BUTTON_PRIMARY,
(int)event.x_root, (int)event.y_root, event.time);
}

reveal_control ();

return false;
});

event_box.button_press_event.connect (event => {
if (event.button == Gdk.BUTTON_PRIMARY) {
mouse_primary_down = true;
}

return false;
});

event_box.button_release_event.connect (event => {
if (event.button == Gdk.BUTTON_PRIMARY) {
mouse_primary_down = false;
}

return false;
});

bottom_bar.notify["should-stay-revealed"].connect (reveal_control);

unfullscreen_button.clicked.connect (() => {
Expand Down
9 changes: 7 additions & 2 deletions src/Window.vala
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,16 @@ public class Audience.Window : Hdy.ApplicationWindow {
};
deck.add (welcome_page_box);

var window_handle = new Hdy.WindowHandle () {
child = deck
};

var manager = Audience.Services.LibraryManager.get_instance ();
app_notification = new Granite.Widgets.Toast ("");

var overlay = new Gtk.Overlay ();
overlay.add (deck);
var overlay = new Gtk.Overlay () {
child = window_handle
};
overlay.add_overlay (app_notification);

add (overlay);
Expand Down

0 comments on commit 972ca33

Please sign in to comment.