Compare commits

...

9 Commits
42.1 ... 42.3

Author SHA1 Message Date
Florian Müllner
8b62c38e20 Bump version to 42.3
Update NEWS.
2022-07-02 18:41:28 +02:00
Florian Müllner
4667b4704d window-list: Open menu on long press
Right-click isn't available on touch, so implement long-press as
an alternative.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/233>
2022-06-20 14:45:58 +02:00
Florian Müllner
fe60614b41 window-list: Fix primary button action on touch
If a click event was triggered via touch rather than a pointer
device, the button parameter is 0 rather than a mouse button
number.

Account for that to make sure that touch events are not misinterpreted
as right clicks.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/233>
2022-06-20 14:45:58 +02:00
Florian Müllner
1e833f542f screenshot-window-sizer: Delay size popup
We use the actual frame size for the popup rather than the target
size. That means (on wayland), we have to wait for the size to
actually change.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/232>
2022-06-09 19:20:44 +02:00
Florian Müllner
faabfa11c2 screenshot-window-sizer: Remove superfluous check
We already filter out sizes that don't fit the screen when
building the scaledSizes array, no need to check again.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/232>
2022-06-09 19:06:24 +02:00
Florian Müllner
959782835d Bump version to 42.2
Update NEWS.
2022-05-28 14:30:58 +02:00
Jason Lynch
412762ae9d window-list: Set visibility based on the target monitor.
Currently, the visibility of the window list on a given monitor is set
according to the fullscreen status of the primary monitor. When a
fullscreen application is on a secondary monitor (but not on the primary
monitor), entering and exiting the overview will lead to the window list
incorrectly being visible on the monitor with the fullscreen
application.

Instead, determine the visibility based on the fullscreen status of the
monitor being evaluated.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/400

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/230>
2022-05-19 18:31:33 -07:00
Florian Müllner
6e4f4126b6 native-window-placement: Adjust to 42 changes
gnome-shell's new screenshot UI reuses the overview's window
picker layout, but its window previews don't give access to
the underlying MetaWindow.

Adjust to that by using the boundingBox property instead, which
is all we really need from the window anyway.

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

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/229>
2022-05-19 19:08:59 +02:00
Cheng-Chia Tseng
5dc212d1e5 Update Chinese (Taiwan) translation 2022-05-11 16:02:45 +00:00
6 changed files with 131 additions and 55 deletions

19
NEWS
View File

@@ -1,3 +1,22 @@
42.3
====
* screenshot-window-sizer: Fix reported sizes on wayland [Florian; !232]
* window-list: Improve touch support [Florian; !233]
Contributors:
Florian Müllner
42.2
====
* native-window-placement: Adjust to gnome-shell 42 changes [Florian; !229]
* window-list: Fix visibility on non-primary monitors [Jason; !230]
Contributors:
Jason Lynch, Florian Müllner
Translators:
Cheng-Chia Tseng [zh_TW]
42.1
====
* Misc. bug fixes and cleanups [Florian; !223, !222, !225]

View File

@@ -97,7 +97,7 @@ class NaturalLayoutStrategy extends Workspace.LayoutStrategy {
let rects = [];
for (let i = 0; i < clones.length; i++) {
// save rectangles into 4-dimensional arrays representing two corners of the rectangular: [left_x, top_y, right_x, bottom_y]
let rect = clones[i].metaWindow.get_frame_rect();
let rect = clones[i].boundingBox;
rects[i] = new Rect(rect.x, rect.y, rect.width, rect.height);
bounds = bounds.union(rects[i]);

View File

@@ -101,10 +101,6 @@ function cycleScreenshotSizes(display, window, binding) {
for (let i = 0; i < scaledSizes.length; i++) {
let [width, height] = scaledSizes[i];
// ignore sizes bigger than the workArea
if (width > workArea.width || height > workArea.height)
continue;
// get the best initial window size
let error = Math.abs(width - outerRect.width) + Math.abs(height - outerRect.height);
if (nearestIndex === undefined || error < nearestError) {
@@ -125,8 +121,18 @@ function cycleScreenshotSizes(display, window, binding) {
if (newY + newHeight > workArea.y + workArea.height)
newY = Math.max(workArea.y + workArea.height - newHeight);
const id = window.connect('size-changed', () => {
window.disconnect(id);
_notifySizeChange(window);
});
window.move_resize_frame(true, newX, newY, newWidth, newHeight);
}
/**
* @param {Meta.Window} window - the window whose size changed
*/
function _notifySizeChange(window) {
const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage);
let newOuterRect = window.get_frame_rect();
let message = '%d×%d'.format(
newOuterRect.width / scaleFactor,

View File

@@ -246,6 +246,48 @@ class BaseButton extends St.Button {
this._updateVisibility();
}
_setLongPressTimeout() {
if (this._longPressTimeoutId)
return;
const { longPressDuration } = Clutter.Settings.get_default();
this._longPressTimeoutId =
GLib.timeout_add(GLib.PRIORITY_DEFAULT, longPressDuration, () => {
delete this._longPressTimeoutId;
if (this._canOpenPopupMenu() && !this._contextMenu.isOpen)
this._openMenu(this._contextMenu);
return GLib.SOURCE_REMOVE;
});
}
_removeLongPressTimeout() {
if (!this._longPressTimeoutId)
return;
GLib.source_remove(this._longPressTimeoutId);
delete this._longPressTimeoutId;
}
vfunc_button_press_event(buttonEvent) {
if (buttonEvent.button === 1)
this._setLongPressTimeout();
return super.vfunc_button_press_event(buttonEvent);
}
vfunc_button_release_event(buttonEvent) {
this._removeLongPressTimeout();
return super.vfunc_button_release_event(buttonEvent);
}
vfunc_touch_event(touchEvent) {
if (touchEvent.type === Clutter.EventType.TOUCH_BEGIN)
this._setLongPressTimeout();
else if (touchEvent.type === Clutter.EventType.TOUCH_END)
this._removeLongPressTimeout();
return super.vfunc_touch_event(touchEvent);
}
activate() {
if (this.active)
return;
@@ -391,7 +433,7 @@ class WindowButton extends BaseButton {
return;
}
if (button === 1)
if (!button || button === 1)
this._minimizeOrActivateWindow(this.metaWindow);
else
this._openMenu(this._contextMenu);
@@ -637,7 +679,7 @@ class AppButton extends BaseButton {
if (contextMenuWasOpen)
this._contextMenu.close();
if (button === 1) {
if (!button || button === 1) {
if (menuWasOpen)
return;
@@ -790,7 +832,7 @@ class WindowList extends St.Widget {
});
this._overviewHidingId = Main.overview.connect('hidden', () => {
this.visible = !Main.layoutManager.primaryMonitor.inFullscreen;
this.visible = !this._monitor.inFullscreen;
this._updateKeyboardAnchor();
});

View File

@@ -1,5 +1,5 @@
project('gnome-shell-extensions',
version: '42.1',
version: '42.3',
meson_version: '>= 0.53.0',
license: 'GPL2+'
)

View File

@@ -9,30 +9,39 @@ msgstr ""
"Project-Id-Version: gnome-shell-extensions gnome-3-0\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gnome-shell-extensions/"
"issues\n"
"POT-Creation-Date: 2020-08-12 23:03+0000\n"
"PO-Revision-Date: 2020-09-22 23:06+0800\n"
"POT-Creation-Date: 2022-05-06 11:44+0000\n"
"PO-Revision-Date: 2022-05-12 00:01+0800\n"
"Last-Translator: Cheng-Chia Tseng <pswo10680@gmail.com>\n"
"Language-Team: Chinese <zh-l10n@linux.org.tw>\n"
"Language: zh_TW\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.4.1\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 3.0.1\n"
#: data/gnome-classic.desktop.in:3
msgid "GNOME Classic"
msgstr "GNOME Classic"
#: data/gnome-classic.desktop.in:4
#: data/gnome-classic.desktop.in:4 data/gnome-classic-wayland.desktop.in:4
#: data/gnome-classic-xorg.desktop.in:4
msgid "This session logs you into GNOME Classic"
msgstr "這個作業階段讓您登入 GNOME Classic"
#: extensions/apps-menu/extension.js:113
msgid "Favorites"
msgstr "喜好"
#: data/gnome-classic-wayland.desktop.in:3
msgid "GNOME Classic on Wayland"
msgstr "GNOME Classic 採行 Wayland"
#: extensions/apps-menu/extension.js:369
#: data/gnome-classic-xorg.desktop.in:3
msgid "GNOME Classic on Xorg"
msgstr "GNOME Classic 採行 Xorg"
#: extensions/apps-menu/extension.js:118
msgid "Favorites"
msgstr "喜愛"
#: extensions/apps-menu/extension.js:379
msgid "Applications"
msgstr "應用程式"
@@ -48,26 +57,26 @@ msgstr ""
"字串的列表,每個都包含一個應用程式 id (桌面檔名稱),後面接著半形分號 \";\" 與"
"工作區號碼"
#: extensions/auto-move-windows/prefs.js:35
#: extensions/auto-move-windows/prefs.js:152
msgid "Workspace Rules"
msgstr "工作區規則"
#: extensions/auto-move-windows/prefs.js:243
#: extensions/auto-move-windows/prefs.js:306
msgid "Add Rule"
msgstr "加入規則"
#. TRANSLATORS: %s is the filesystem name
#: extensions/drive-menu/extension.js:112
#: extensions/places-menu/placeDisplay.js:233
#: extensions/drive-menu/extension.js:126
#: extensions/places-menu/placeDisplay.js:210
#, javascript-format
msgid "Ejecting drive “%s” failed:"
msgstr "裝置「%s」退出失敗"
#: extensions/drive-menu/extension.js:128
#: extensions/drive-menu/extension.js:145
msgid "Removable devices"
msgstr "可移除式裝置"
#: extensions/drive-menu/extension.js:155
#: extensions/drive-menu/extension.js:167
msgid "Open Files"
msgstr "開啟檔案"
@@ -97,31 +106,31 @@ msgstr ""
"如果為真,在對映的縮圖頂端放置視窗說明標題,凌駕 Shell 將它放置在底部的預設"
"值。變更這個設定值需要重新啟動 Shell 來套用效果。"
#: extensions/places-menu/extension.js:89
#: extensions/places-menu/extension.js:93
#: extensions/places-menu/extension.js:94
#: extensions/places-menu/extension.js:97
msgid "Places"
msgstr "位置"
#: extensions/places-menu/placeDisplay.js:46
#: extensions/places-menu/placeDisplay.js:49
#, javascript-format
msgid "Failed to launch “%s”"
msgstr "無法啟動「%s」"
#: extensions/places-menu/placeDisplay.js:61
#: extensions/places-menu/placeDisplay.js:64
#, javascript-format
msgid "Failed to mount volume for “%s”"
msgstr "無法掛載儲存區「%s」"
#: extensions/places-menu/placeDisplay.js:125
#: extensions/places-menu/placeDisplay.js:148
#: extensions/places-menu/placeDisplay.js:171
msgid "Computer"
msgstr "電腦"
#: extensions/places-menu/placeDisplay.js:359
#: extensions/places-menu/placeDisplay.js:336
msgid "Home"
msgstr "家目錄"
#: extensions/places-menu/placeDisplay.js:404
#: extensions/places-menu/placeDisplay.js:381
msgid "Browse Network"
msgstr "瀏覽網路"
@@ -141,47 +150,47 @@ msgstr "主題名稱"
msgid "The name of the theme, to be loaded from ~/.themes/name/gnome-shell"
msgstr "主題的名稱,要從 ~/.themes/name/gnome-shell 載入"
#: extensions/window-list/extension.js:98
#: extensions/window-list/extension.js:72
msgid "Close"
msgstr "關閉"
#: extensions/window-list/extension.js:118
#: extensions/window-list/extension.js:92
msgid "Unminimize"
msgstr "取消最小化"
#: extensions/window-list/extension.js:118
#: extensions/window-list/extension.js:92
msgid "Minimize"
msgstr "最小化"
#: extensions/window-list/extension.js:125
#: extensions/window-list/extension.js:99
msgid "Unmaximize"
msgstr "取消最大化"
#: extensions/window-list/extension.js:125
#: extensions/window-list/extension.js:99
msgid "Maximize"
msgstr "最大化"
#: extensions/window-list/extension.js:428
#: extensions/window-list/extension.js:441
msgid "Minimize all"
msgstr "全部最小化"
#: extensions/window-list/extension.js:434
#: extensions/window-list/extension.js:447
msgid "Unminimize all"
msgstr "全部取消最小化"
#: extensions/window-list/extension.js:440
#: extensions/window-list/extension.js:453
msgid "Maximize all"
msgstr "全部最大化"
#: extensions/window-list/extension.js:448
#: extensions/window-list/extension.js:461
msgid "Unmaximize all"
msgstr "全部取消最大化"
#: extensions/window-list/extension.js:456
#: extensions/window-list/extension.js:469
msgid "Close all"
msgstr "全部關閉"
#: extensions/window-list/extension.js:734
#: extensions/window-list/extension.js:753
msgid "Window List"
msgstr "視窗列表"
@@ -197,7 +206,7 @@ msgstr ""
"決定在視窗列表中何時群組視窗。可能的數值有「never」、「auto」、「always」。"
#: extensions/window-list/org.gnome.shell.extensions.window-list.gschema.xml:20
#: extensions/window-list/prefs.js:100
#: extensions/window-list/prefs.js:79
msgid "Show windows from all workspaces"
msgstr "顯示所有工作區的視窗"
@@ -215,41 +224,41 @@ msgid ""
"primary one."
msgstr "是否在所有連接的螢幕顯示視窗列表或是只出現在主要螢幕上。"
#: extensions/window-list/prefs.js:29
#: extensions/window-list/prefs.js:35
msgid "Window Grouping"
msgstr "視窗群組"
#: extensions/window-list/prefs.js:58
#: extensions/window-list/prefs.js:40
msgid "Never group windows"
msgstr "永不群組視窗"
#: extensions/window-list/prefs.js:59
#: extensions/window-list/prefs.js:41
msgid "Group windows when space is limited"
msgstr "當空間受限時群組視窗"
#: extensions/window-list/prefs.js:60
#: extensions/window-list/prefs.js:42
msgid "Always group windows"
msgstr "永遠群組視窗"
#: extensions/window-list/prefs.js:94
#: extensions/window-list/prefs.js:66
msgid "Show on all monitors"
msgstr "顯示於所有螢幕"
#: extensions/window-list/workspaceIndicator.js:207
#: extensions/workspace-indicator/extension.js:213
#: extensions/window-list/workspaceIndicator.js:261
#: extensions/workspace-indicator/extension.js:266
msgid "Workspace Indicator"
msgstr "工作區指示器"
#: extensions/workspace-indicator/prefs.js:34
msgid "Workspace Names"
msgstr "工作區名稱"
#: extensions/workspace-indicator/prefs.js:67
#: extensions/workspace-indicator/prefs.js:62
#, javascript-format
msgid "Workspace %d"
msgstr "工作區 %d"
#: extensions/workspace-indicator/prefs.js:218
#: extensions/workspace-indicator/prefs.js:129
msgid "Workspace Names"
msgstr "工作區名稱"
#: extensions/workspace-indicator/prefs.js:255
msgid "Add Workspace"
msgstr "新增工作區"