Compare commits

...

14 Commits
46.2 ... 45.2

Author SHA1 Message Date
Florian Müllner
b02e43d84c Bump version to 45.2
Update NEWS.
2023-12-01 20:15:09 +01:00
Florian Müllner
8ed3b72a56 workspace-indicator: Update visibility on window-type changes
The visibility depends on the type, so we should listen for
changes (even if the property is unlikely to change).

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/292>
(cherry picked from commit 30a15387b5)
2023-12-01 20:03:38 +01:00
Florian Müllner
a929cf9370 workspace-indicator: Don't hide previews on other monitors
Workspace thumbnails are clipped, so there's no major benefit
of hiding the actors explicitly.

On the other hand, the check is useful on size/position changes
to avoid unnecessary relayouts.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/292>
(cherry picked from commit b5b841dd38)
2023-12-01 20:03:38 +01:00
Florian Müllner
a5343c33ec window-list: Update visibility on window-type changes
The visibility depends on the type, so we should listen for
changes (even if the property is unlikely to change).

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/292>
(cherry picked from commit 071584621e)
2023-12-01 20:03:15 +01:00
Florian Müllner
8efd73c50e window-list: Don't hide previews on other monitors
Workspace thumbnails are clipped, so there's no major benefit
of hiding the actors explicitly.

On the other hand, the check is useful on size/position changes
to avoid unnecessary relayouts.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/292>
(cherry picked from commit 5c57f44838)
2023-12-01 20:03:15 +01:00
Florian Müllner
d5f617b3e2 window-list: Move additional padding into buttons
Commit ca1c4b0f9e added additional padding, which means that the
interactive area of buttons no longer extends to the bottom of
the screen.

Address this by moving the new padding into the buttons themselves.
That restores the Fittsability of the bottom bar, without affecting
the cleaner visual appearance.

Close https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/453

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/291>
2023-12-01 20:02:51 +01:00
Florian Müllner
d1ff099200 window-list: Clean up stylesheet indent
Replaces tabs with spaces.

Part-of:
<https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/291>
2023-12-01 20:02:49 +01:00
Florian Müllner
6bbc329e7b apps-menu: Use customized layout manager to limit height
To avoid continuous height changes while browsing through categories,
we let the list of categories determine the overall height, and rely
on scrolling for the list of apps within a category.

We currently achieve this by assigning a fixed height via the
`style` property. This has been found to trigger a crash when
running headless, as we end up querying an actor's height request
before a valid resource scale is available.

Instead, use a custom layout manager, which seems more elegant anyway.

Close: https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/472
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/290>
(cherry picked from commit 5652182fb3)
2023-12-01 19:48:04 +01:00
Florian Müllner
ed31f08f2f apps-menu: Remove vertical separator
Ever since gnome-shell stopped using a stippled separator in the
calendar menu, the styling required by the separator has been
missing.

There haven't been any complaints about the invisible separator,
so we can just as well drop it altogether.

Part-of:
<https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/290>
(cherry picked from commit c3cbef19ac)
2023-12-01 19:48:03 +01:00
Florian Müllner
ed60502f10 apps-menu: Use stylesheet to set width
The `style` property is useful for computed CSS declarations,
but for regular styling the stylesheet is preferable.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/290>
(cherry picked from commit 8c8f990a28)
2023-12-01 19:47:16 +01:00
Florian Müllner
0fa592a516 apps-menu: Adjust to events API changes
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/290>
(cherry picked from commit f6a6bdda99)
2023-12-01 19:47:16 +01:00
Florian Müllner
f27b239f55 Bump version to 45.1
Update NEWS.
2023-11-01 00:28:14 +01:00
Florian Müllner
7f192d0208 screenshot-window-sizer: Handle wrapping around backwards
The mod takes care of wrapping at the top, but not when
decrementing 0. Fix this by using Array.prototype.at(),
which handles negative indexes.

Close https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/467

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/284>
(cherry picked from commit dd8ee2931a)
2023-11-01 00:24:47 +01:00
Florian Müllner
eff6f6ef88 screenshot-window-sizer: Use built-in support for reversed bindings
Mutter has had explicit support for reversed bindings for a while now.
Use that, as it's more reliably than examining the modifiers manually.

Close https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/467

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/284>
(cherry picked from commit f530acbf9e)
2023-11-01 00:24:47 +01:00
9 changed files with 110 additions and 103 deletions

23
NEWS
View File

@@ -1,3 +1,26 @@
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]
* screenshot-window-sizer: Fix cycling between sizes backwards [Florian; !284]
* Misc. bug fixes and cleanups [Florian; !276, !275, !278, !281]
Contributors:
Florian Müllner
Translators:
Kristjan SCHMIDT [eo], Brage Fuglseth [nb]
45.0
====

View File

@@ -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) {

View File

@@ -4,6 +4,8 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/
.apps-menu {width: 26em;}
.apps-menu:ltr {
padding-right: 3px;
}

View File

@@ -65,10 +65,7 @@ export default class ScreenshotWindowSizerExtension extends Extension {
* @param {Meta.KeyBinding} binding - the key binding
*/
_cycleScreenshotSizes(display, window, binding) {
// Probably this isn't useful with 5 sizes, but you can decrease instead
// of increase by holding down shift.
let modifiers = binding.get_modifiers();
let backwards = (modifiers & Meta.VirtualModifier.SHIFT_MASK) !== 0;
const backwards = binding.is_reversed();
// Unmaximize first
if (window.get_maximized() !== 0)
@@ -99,7 +96,7 @@ export default class ScreenshotWindowSizerExtension extends Extension {
// get the next size up or down from ideal
let newIndex = (nearestIndex + (backwards ? -1 : 1)) % scaledSizes.length;
let [newWidth, newHeight] = scaledSizes[newIndex];
let [newWidth, newHeight] = scaledSizes.at(newIndex);
// Push the window onscreen if it would be resized offscreen
let newX = outerRect.x;

View File

@@ -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;
}

View File

@@ -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,

View File

@@ -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();
}
}

View File

@@ -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();
}
}

View File

@@ -3,7 +3,7 @@
# SPDX-License-Identifier: GPL-2.0-or-later
project('gnome-shell-extensions',
version: '45.0',
version: '45.2',
meson_version: '>= 0.58.0',
license: 'GPL2+'
)