Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8b62c38e20 | |||
| 4667b4704d | |||
| fe60614b41 | |||
| 1e833f542f | |||
| faabfa11c2 |
@@ -1,3 +1,11 @@
|
|||||||
|
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
|
42.2
|
||||||
====
|
====
|
||||||
* native-window-placement: Adjust to gnome-shell 42 changes [Florian; !229]
|
* native-window-placement: Adjust to gnome-shell 42 changes [Florian; !229]
|
||||||
|
|||||||
@@ -101,10 +101,6 @@ function cycleScreenshotSizes(display, window, binding) {
|
|||||||
for (let i = 0; i < scaledSizes.length; i++) {
|
for (let i = 0; i < scaledSizes.length; i++) {
|
||||||
let [width, height] = scaledSizes[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
|
// get the best initial window size
|
||||||
let error = Math.abs(width - outerRect.width) + Math.abs(height - outerRect.height);
|
let error = Math.abs(width - outerRect.width) + Math.abs(height - outerRect.height);
|
||||||
if (nearestIndex === undefined || error < nearestError) {
|
if (nearestIndex === undefined || error < nearestError) {
|
||||||
@@ -125,8 +121,18 @@ function cycleScreenshotSizes(display, window, binding) {
|
|||||||
if (newY + newHeight > workArea.y + workArea.height)
|
if (newY + newHeight > workArea.y + workArea.height)
|
||||||
newY = Math.max(workArea.y + workArea.height - newHeight);
|
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);
|
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 newOuterRect = window.get_frame_rect();
|
||||||
let message = '%d×%d'.format(
|
let message = '%d×%d'.format(
|
||||||
newOuterRect.width / scaleFactor,
|
newOuterRect.width / scaleFactor,
|
||||||
|
|||||||
@@ -246,6 +246,48 @@ class BaseButton extends St.Button {
|
|||||||
this._updateVisibility();
|
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() {
|
activate() {
|
||||||
if (this.active)
|
if (this.active)
|
||||||
return;
|
return;
|
||||||
@@ -391,7 +433,7 @@ class WindowButton extends BaseButton {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (button === 1)
|
if (!button || button === 1)
|
||||||
this._minimizeOrActivateWindow(this.metaWindow);
|
this._minimizeOrActivateWindow(this.metaWindow);
|
||||||
else
|
else
|
||||||
this._openMenu(this._contextMenu);
|
this._openMenu(this._contextMenu);
|
||||||
@@ -637,7 +679,7 @@ class AppButton extends BaseButton {
|
|||||||
if (contextMenuWasOpen)
|
if (contextMenuWasOpen)
|
||||||
this._contextMenu.close();
|
this._contextMenu.close();
|
||||||
|
|
||||||
if (button === 1) {
|
if (!button || button === 1) {
|
||||||
if (menuWasOpen)
|
if (menuWasOpen)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
project('gnome-shell-extensions',
|
project('gnome-shell-extensions',
|
||||||
version: '42.2',
|
version: '42.3',
|
||||||
meson_version: '>= 0.53.0',
|
meson_version: '>= 0.53.0',
|
||||||
license: 'GPL2+'
|
license: 'GPL2+'
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user