Fix window "fullscreen-changed" signal

This commit is contained in:
Rafostar
2020-10-06 12:04:28 +02:00
parent bae0b805ea
commit dbdb6988a2
2 changed files with 16 additions and 13 deletions

View File

@@ -164,6 +164,9 @@ var App = GObject.registerClass({
if(!this.player.widget) if(!this.player.widget)
return this.quit(); return this.quit();
this.player.widget.width_request = 960;
this.player.widget.height_request = 540;
/* /*
this.player.widget.add_events( this.player.widget.add_events(
Gdk.EventMask.SCROLL_MASK Gdk.EventMask.SCROLL_MASK

View File

@@ -13,14 +13,11 @@ var Window = GObject.registerClass({
super._init({ super._init({
application: application, application: application,
title: title || 'Clapper', title: title || 'Clapper',
//border_width: 0,
resizable: true, resizable: true,
//window_position: Gtk.WindowPosition.CENTER,
width_request: 960,
height_request: 642,
destroy_with_parent: true, destroy_with_parent: true,
}); });
this.isFullscreen = false; this.isFullscreen = false;
this.mapSignal = this.connect('map', this._onMap.bind(this));
} }
toggleFullscreen() toggleFullscreen()
@@ -28,15 +25,11 @@ var Window = GObject.registerClass({
let un = (this.isFullscreen) ? 'un' : ''; let un = (this.isFullscreen) ? 'un' : '';
this[`${un}fullscreen`](); this[`${un}fullscreen`]();
} }
/*
vfunc_window_state_event(event)
{
super.vfunc_window_state_event(event);
let isFullscreen = Boolean( _onStateNotify(toplevel)
event.new_window_state {
& Gdk.WindowState.FULLSCREEN let { state } = toplevel;
); let isFullscreen = Boolean(state & Gdk.ToplevelState.FULLSCREEN);
if(this.isFullscreen === isFullscreen) if(this.isFullscreen === isFullscreen)
return; return;
@@ -44,5 +37,12 @@ var Window = GObject.registerClass({
this.isFullscreen = isFullscreen; this.isFullscreen = isFullscreen;
this.emit('fullscreen-changed', this.isFullscreen); this.emit('fullscreen-changed', this.isFullscreen);
} }
*/
_onMap()
{
this.disconnect(this.mapSignal);
let surface = this.get_surface();
surface.connect('notify::state', this._onStateNotify.bind(this));
}
}); });