mirror of
				https://github.com/Rafostar/clapper.git
				synced 2025-10-31 18:35:38 +01:00 
			
		
		
		
	Listen for key presses on window instead of player
This fixes a GNOME bug where sometimes key press events are not emited
This commit is contained in:
		| @@ -57,7 +57,13 @@ var App = GObject.registerClass({ | |||||||
|     _buildUI() |     _buildUI() | ||||||
|     { |     { | ||||||
|         this.window = new Window(this, APP_NAME); |         this.window = new Window(this, APP_NAME); | ||||||
|         this.window.connect('realize', this._onWindowRealize.bind(this)); |  | ||||||
|  |         this.window.connect( | ||||||
|  |             'realize', this._onWindowRealize.bind(this) | ||||||
|  |         ); | ||||||
|  |         this.window.connect( | ||||||
|  |             'key-press-event', this._onWindowKeyPressEvent.bind(this) | ||||||
|  |         ); | ||||||
|         this.window.connect( |         this.window.connect( | ||||||
|             'fullscreen-changed', this._onWindowFullscreenChanged.bind(this) |             'fullscreen-changed', this._onWindowFullscreenChanged.bind(this) | ||||||
|         ); |         ); | ||||||
| @@ -88,9 +94,6 @@ var App = GObject.registerClass({ | |||||||
|         this.player.connect('warning', this._onPlayerWarning.bind(this)); |         this.player.connect('warning', this._onPlayerWarning.bind(this)); | ||||||
|         this.player.connect('error', this._onPlayerError.bind(this)); |         this.player.connect('error', this._onPlayerError.bind(this)); | ||||||
|  |  | ||||||
|         this.player.widget.connect( |  | ||||||
|             'key-press-event', this._onPlayerKeyPressEvent.bind(this) |  | ||||||
|         ); |  | ||||||
|         this.player.widget.connect( |         this.player.widget.connect( | ||||||
|             'button-press-event', this._onPlayerButtonPressEvent.bind(this) |             'button-press-event', this._onPlayerButtonPressEvent.bind(this) | ||||||
|         ); |         ); | ||||||
| @@ -142,7 +145,7 @@ var App = GObject.registerClass({ | |||||||
|         this.interface.controls[action](); |         this.interface.controls[action](); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     _onPlayerKeyPressEvent(self, event) |     _onWindowKeyPressEvent(self, event) | ||||||
|     { |     { | ||||||
|         let [res, key] = event.get_keyval(); |         let [res, key] = event.get_keyval(); | ||||||
|         if(!res) return; |         if(!res) return; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user