From 764d18a0902d3388e894ea3c53e43d04e4ecd625 Mon Sep 17 00:00:00 2001 From: abakkk Date: Sat, 16 Mar 2019 12:35:14 +0100 Subject: [PATCH] replace DrawingArea._onStyleChanged() by DrawingArea._updateStyle() In test of gnome-shell 32 (in VM), 'style-changed' was regularly emitted during drawing, so all 'this.current...' style properties was initialized and it was impossible to select style with 'Ctrl+...' shortcuts. Now style is gathered on drawing mode entered, which is by the way more frugal. Keep watch possible regressions. --- draw.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/draw.js b/draw.js index 54ee05b..e57beb6 100644 --- a/draw.js +++ b/draw.js @@ -55,9 +55,6 @@ var DrawingArea = new Lang.Class({ _init: function(params, monitor, helper, loadJson) { this.parent({ style_class: 'draw-on-your-screen', name: params && params.name ? params.name : ""}); - // 'style-changed' is emitted when 'this' is added to an actor - // ('this' needs to be in the stage to query theme_node) - this.connect('style-changed', this._onStyleChanged.bind(this)); this.connect('repaint', this._repaint.bind(this)); this.settings = Convenience.getSettings(); @@ -84,7 +81,7 @@ var DrawingArea = new Lang.Class({ this.queue_repaint(); }, - _onStyleChanged: function() { + _updateStyle: function() { try { let themeNode = this.get_theme_node(); for (let i = 1; i < 10; i++) { @@ -470,6 +467,7 @@ var DrawingArea = new Lang.Class({ this.scrollHandler = this.connect('scroll-event', this._onScroll.bind(this)); this.selectShape(Shapes.NONE); this.get_parent().set_background_color(this.hasBackground ? this.activeBackgroundColor : null); + this._updateStyle(); }, leaveDrawingMode: function(save) {