Compare commits

...

3 Commits
48.2 ... 45.1

Author SHA1 Message Date
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
3 changed files with 15 additions and 6 deletions

12
NEWS
View File

@@ -1,3 +1,15 @@
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

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

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