diff --git a/NEWS b/NEWS index 8c493511..54107e7d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,14 @@ +45.2 +==== +* window-list: Fix buttons not being clickable at the screen edge + [Florian; !291] +* window-list: Really fix initial preview visibility [Florian; !292] +* workspace-indicator: Really fix initial preview visibility [Florian; !292] +* Misc. bug fixes and cleanups [Florian; !290] + +Contributors: + Florian Müllner + 45.1 ==== * workspace-indicator: Fix initial preview visibility [Florian; !280] diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index 6eb58f10..5e80fcec 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -214,9 +214,9 @@ class CategoryMenuItem extends PopupMenu.PopupBaseMenuItem { this._grab?.dismiss(); delete this._grab; - let source = event.get_source(); - if (source instanceof St.Widget) - source.sync_hover(); + const targetActor = global.stage.get_event_actor(event); + if (targetActor instanceof St.Widget) + targetActor.sync_hover(); return false; } @@ -363,6 +363,20 @@ class DesktopTarget extends EventEmitter { } } +class MainLayout extends Clutter.BoxLayout { + static { + GObject.registerClass(this); + } + + vfunc_get_preferred_height(container, forWidth) { + const [mainChild] = container; + const [minHeight, natHeight] = + mainChild.get_preferred_height(forWidth); + + return [minHeight, natHeight + MENU_HEIGHT_OFFSET]; + } +} + class ApplicationsButton extends PanelMenu.Button { static { GObject.registerClass(this); @@ -432,15 +446,6 @@ class ApplicationsButton extends PanelMenu.Button { } } - _createVertSeparator() { - let separator = new St.DrawingArea({ - style_class: 'calendar-vertical-separator', - pseudo_class: 'highlighted', - }); - separator.connect('repaint', this._onVertSepRepaint.bind(this)); - return separator; - } - _onDestroy() { super._onDestroy(); @@ -462,21 +467,6 @@ class ApplicationsButton extends PanelMenu.Button { return super._onMenuKeyPress(actor, event); } - _onVertSepRepaint(area) { - let cr = area.get_context(); - let themeNode = area.get_theme_node(); - let [width, height] = area.get_surface_size(); - let stippleColor = themeNode.get_color('-stipple-color'); - let stippleWidth = themeNode.get_length('-stipple-width'); - let x = Math.floor(width / 2) + 0.5; - cr.moveTo(x, 0); - cr.lineTo(x, height); - Clutter.cairo_set_source_color(cr, stippleColor); - cr.setDash([1, 3], 1); // Hard-code for now - cr.setLineWidth(stippleWidth); - cr.stroke(); - } - _onOpenStateChanged(menu, open) { if (open) { if (this.reloadFlag) { @@ -554,7 +544,7 @@ class ApplicationsButton extends PanelMenu.Button { _createLayout() { let section = new PopupMenu.PopupMenuSection(); this.menu.addMenuItem(section); - this.mainBox = new St.BoxLayout({vertical: false}); + this.mainBox = new St.BoxLayout({layoutManager: new MainLayout()}); this.leftBox = new St.BoxLayout({vertical: true}); this.applicationsScrollBox = new St.ScrollView({ style_class: 'apps-menu vfade', @@ -583,14 +573,12 @@ class ApplicationsButton extends PanelMenu.Button { this.categoriesScrollBox.add_actor(this.categoriesBox); this.mainBox.add(this.leftBox); - this.mainBox.add_child(this._createVertSeparator()); this.mainBox.add_child(this.applicationsScrollBox); section.actor.add_actor(this.mainBox); } _display() { this._applicationsButtons.clear(); - this.mainBox.style = 'width: 35em;'; this.mainBox.hide(); // Load categories @@ -620,12 +608,6 @@ class ApplicationsButton extends PanelMenu.Button { // Load applications this._displayButtons(this._listApplications(null)); - - let themeContext = St.ThemeContext.get_for_stage(global.stage); - let scaleFactor = themeContext.scale_factor; - let categoriesHeight = this.categoriesBox.height / scaleFactor; - let height = Math.round(categoriesHeight) + MENU_HEIGHT_OFFSET; - this.mainBox.style += `height: ${height}px`; } selectCategory(dir) { diff --git a/extensions/apps-menu/stylesheet.css b/extensions/apps-menu/stylesheet.css index a5aae0b0..16eed17b 100644 --- a/extensions/apps-menu/stylesheet.css +++ b/extensions/apps-menu/stylesheet.css @@ -4,6 +4,8 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ +.apps-menu {width: 26em;} + .apps-menu:ltr { padding-right: 3px; } diff --git a/extensions/window-list/stylesheet-dark.css b/extensions/window-list/stylesheet-dark.css index 5537e398..9ef5f25b 100644 --- a/extensions/window-list/stylesheet-dark.css +++ b/extensions/window-list/stylesheet-dark.css @@ -6,115 +6,115 @@ */ .window-list { - spacing: 2px; - font-size: 10pt; + spacing: 2px; + font-size: 10pt; } .bottom-panel { - background-color: #000000; - border-top-width: 0px; - padding: 2px; + background-color: #000000; + border-top-width: 0px; + height: 2.45em; } .window-button { - padding: 2px, 1px; + padding: 4px, 3px; } .window-button:first-child:ltr { - padding-left: 2px; + padding-left: 2px; } .window-button:last-child:rtl { - padding-right: 2px; + padding-right: 2px; } .window-button-box { - spacing: 4px; + spacing: 4px; } .window-button > StWidget, .window-picker-toggle > StWidget { - color: #bbb; - background-color: #1d1d1d; - border-radius: 4px; - padding: 3px 6px 1px; - transition: 100ms ease; + color: #bbb; + background-color: #1d1d1d; + border-radius: 4px; + padding: 3px 6px 1px; + transition: 100ms ease; } .window-button > StWidget { - -st-natural-width: 18.75em; - max-width: 18.75em; + -st-natural-width: 18.75em; + max-width: 18.75em; } .window-button:hover > StWidget, .window-picker-toggle:hover > StWidget { - color: #fff; - background-color: #303030; + color: #fff; + background-color: #303030; } .window-button:active > StWidget, .window-button:focus > StWidget { - color: #fff; - background-color: #3f3f3f; + color: #fff; + background-color: #3f3f3f; } .window-button.focused > StWidget, .window-picker-toggle:checked > StWidget { - color: #fff; - background-color: #3f3f3f; + color: #fff; + background-color: #3f3f3f; } .window-button.focused:active > StWidget, .window-picker-toggle:checked:active > StWidget { - color: #fff; - background-color: #3f3f3f; + color: #fff; + background-color: #3f3f3f; } .window-button.minimized > StWidget { - color: #666; - background-color: #161616; + color: #666; + background-color: #161616; } .window-button.minimized:active > StWidget { - color: #666; - background-color: #161616; + color: #666; + background-color: #161616; } .window-button-icon { - width: 24px; - height: 24px; + width: 24px; + height: 24px; } .window-list-workspace-indicator .status-label-bin { - background-color: rgba(200, 200, 200, 0.3); - padding: 0 3px; - margin: 3px; + background-color: rgba(200, 200, 200, 0.3); + padding: 5px; + margin: 3px; } .window-list-workspace-indicator .workspaces-box { - spacing: 3px; - padding: 3px; + spacing: 3px; + padding: 5px; } .window-list-workspace-indicator .workspace { - width: 52px; - border-radius: 4px; - background-color: #1e1e1e; + width: 52px; + border-radius: 4px; + background-color: #1e1e1e; } .window-list-workspace-indicator .workspace.active { - background-color: #3f3f3f; + background-color: #3f3f3f; } .window-list-window-preview { - background-color: #bebebe; - border-radius: 1px; + background-color: #bebebe; + border-radius: 1px; } .window-list-window-preview.active { - background-color: #d4d4d4; + background-color: #d4d4d4; } .notification { - font-weight: normal; + font-weight: normal; } diff --git a/extensions/window-list/stylesheet-light.css b/extensions/window-list/stylesheet-light.css index 0bb2ab16..d52fd6b4 100644 --- a/extensions/window-list/stylesheet-light.css +++ b/extensions/window-list/stylesheet-light.css @@ -10,8 +10,7 @@ #panel.bottom-panel { border-top-width: 1px; border-bottom-width: 0px; - height: 2.25em ; - padding: 2px; + height: 2.5em; } .bottom-panel .window-button > StWidget, diff --git a/extensions/window-list/workspaceIndicator.js b/extensions/window-list/workspaceIndicator.js index 64e2071f..e576a9af 100644 --- a/extensions/window-list/workspaceIndicator.js +++ b/extensions/window-list/workspaceIndicator.js @@ -36,12 +36,10 @@ class WindowPreview extends St.Button { this._window = window; this._window.connectObject( - 'size-changed', () => this.queue_relayout(), - 'position-changed', () => { - this._updateVisible(); - this.queue_relayout(); - }, + 'size-changed', () => this._checkRelayout(), + 'position-changed', () => this._checkRelayout(), 'notify::minimized', this._updateVisible.bind(this), + 'notify::window-type', this._updateVisible.bind(this), this); this._updateVisible(); @@ -62,11 +60,15 @@ class WindowPreview extends St.Button { this.remove_style_class_name('active'); } - _updateVisible() { + _checkRelayout() { const monitor = Main.layoutManager.findIndexForActor(this); const workArea = Main.layoutManager.getWorkAreaForMonitor(monitor); - this.visible = this._window.get_frame_rect().overlap(workArea) && - this._window.window_type !== Meta.WindowType.DESKTOP && + if (this._window.get_frame_rect().overlap(workArea)) + this.queue_relayout(); + } + + _updateVisible() { + this.visible = this._window.window_type !== Meta.WindowType.DESKTOP && this._window.showing_on_its_workspace(); } } diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js index 0df9e038..58adf52f 100644 --- a/extensions/workspace-indicator/extension.js +++ b/extensions/workspace-indicator/extension.js @@ -42,12 +42,10 @@ class WindowPreview extends St.Button { this._window = window; this._window.connectObject( - 'size-changed', () => this.queue_relayout(), - 'position-changed', () => { - this._updateVisible(); - this.queue_relayout(); - }, + 'size-changed', () => this._checkRelayout(), + 'position-changed', () => this._checkRelayout(), 'notify::minimized', this._updateVisible.bind(this), + 'notify::window-type', this._updateVisible.bind(this), this); this._updateVisible(); @@ -68,11 +66,15 @@ class WindowPreview extends St.Button { this.remove_style_class_name('active'); } - _updateVisible() { + _checkRelayout() { const monitor = Main.layoutManager.findIndexForActor(this); const workArea = Main.layoutManager.getWorkAreaForMonitor(monitor); - this.visible = this._window.get_frame_rect().overlap(workArea) && - this._window.window_type !== Meta.WindowType.DESKTOP && + if (this._window.get_frame_rect().overlap(workArea)) + this.queue_relayout(); + } + + _updateVisible() { + this.visible = this._window.window_type !== Meta.WindowType.DESKTOP && this._window.showing_on_its_workspace(); } } diff --git a/meson.build b/meson.build index f70c07d5..e70d6af5 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later project('gnome-shell-extensions', - version: '45.1', + version: '45.2', meson_version: '>= 0.58.0', license: 'GPL2+' )