mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
Fix window "fullscreen-changed" signal
This commit is contained in:
@@ -164,6 +164,9 @@ var App = GObject.registerClass({
|
||||
|
||||
if(!this.player.widget)
|
||||
return this.quit();
|
||||
|
||||
this.player.widget.width_request = 960;
|
||||
this.player.widget.height_request = 540;
|
||||
/*
|
||||
this.player.widget.add_events(
|
||||
Gdk.EventMask.SCROLL_MASK
|
||||
|
@@ -13,14 +13,11 @@ var Window = GObject.registerClass({
|
||||
super._init({
|
||||
application: application,
|
||||
title: title || 'Clapper',
|
||||
//border_width: 0,
|
||||
resizable: true,
|
||||
//window_position: Gtk.WindowPosition.CENTER,
|
||||
width_request: 960,
|
||||
height_request: 642,
|
||||
destroy_with_parent: true,
|
||||
});
|
||||
this.isFullscreen = false;
|
||||
this.mapSignal = this.connect('map', this._onMap.bind(this));
|
||||
}
|
||||
|
||||
toggleFullscreen()
|
||||
@@ -28,15 +25,11 @@ var Window = GObject.registerClass({
|
||||
let un = (this.isFullscreen) ? 'un' : '';
|
||||
this[`${un}fullscreen`]();
|
||||
}
|
||||
/*
|
||||
vfunc_window_state_event(event)
|
||||
{
|
||||
super.vfunc_window_state_event(event);
|
||||
|
||||
let isFullscreen = Boolean(
|
||||
event.new_window_state
|
||||
& Gdk.WindowState.FULLSCREEN
|
||||
);
|
||||
_onStateNotify(toplevel)
|
||||
{
|
||||
let { state } = toplevel;
|
||||
let isFullscreen = Boolean(state & Gdk.ToplevelState.FULLSCREEN);
|
||||
|
||||
if(this.isFullscreen === isFullscreen)
|
||||
return;
|
||||
@@ -44,5 +37,12 @@ var Window = GObject.registerClass({
|
||||
this.isFullscreen = 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));
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user