[sushi/wip/cosimoc/no-clutter: 20/66] mainWindow: resize window on size-allocate
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sushi/wip/cosimoc/no-clutter: 20/66] mainWindow: resize window on size-allocate
- Date: Sat, 8 Jun 2019 18:41:50 +0000 (UTC)
commit 7870c31743fb03e3dc1b60ac307171e3316bd476
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Apr 3 12:46:23 2017 -0700
mainWindow: resize window on size-allocate
Whenever we get a new allocation for the window contents, we should also
recompute the window size.
src/js/ui/mainWindow.js | 9 +++++++++
1 file changed, 9 insertions(+)
---
diff --git a/src/js/ui/mainWindow.js b/src/js/ui/mainWindow.js
index 62eeb21..ec9153e 100644
--- a/src/js/ui/mainWindow.js
+++ b/src/js/ui/mainWindow.js
@@ -86,6 +86,8 @@ var MainWindow = new Lang.Class({
Lang.bind(this, this._onMotionNotifyEvent));
this._gtkWindow.connect('realize',
Lang.bind(this, this._onRealize));
+ this._gtkWindow.connect('size-allocate',
+ Lang.bind(this, this._onSizeAllocate));
this._embed = new Gtk.Overlay();
this._gtkWindow.add(this._embed);
@@ -105,6 +107,13 @@ var MainWindow = new Lang.Class({
Gdk.WMFunction.CLOSE);
},
+ _onSizeAllocate: function() {
+ if (!this._renderer)
+ return;
+
+ this._positionTexture();
+ },
+
_onKeyPressEvent : function(widget, event) {
let key = event.get_keyval()[1];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]