Codebase list gnome-shell-extensions / 08c5489
New upstream version 42.3 Daniel Ruiz de Alegría 1 year, 7 months ago
4 changed file(s) with 63 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
0 42.3
1 ====
2 * screenshot-window-sizer: Fix reported sizes on wayland [Florian; !232]
3 * window-list: Improve touch support [Florian; !233]
4
5 Contributors:
6 Florian Müllner
7
08 42.2
19 ====
210 * native-window-placement: Adjust to gnome-shell 42 changes [Florian; !229]
100100 for (let i = 0; i < scaledSizes.length; i++) {
101101 let [width, height] = scaledSizes[i];
102102
103 // ignore sizes bigger than the workArea
104 if (width > workArea.width || height > workArea.height)
105 continue;
106
107103 // get the best initial window size
108104 let error = Math.abs(width - outerRect.width) + Math.abs(height - outerRect.height);
109105 if (nearestIndex === undefined || error < nearestError) {
124120 if (newY + newHeight > workArea.y + workArea.height)
125121 newY = Math.max(workArea.y + workArea.height - newHeight);
126122
123 const id = window.connect('size-changed', () => {
124 window.disconnect(id);
125 _notifySizeChange(window);
126 });
127127 window.move_resize_frame(true, newX, newY, newWidth, newHeight);
128 }
128129
130 /**
131 * @param {Meta.Window} window - the window whose size changed
132 */
133 function _notifySizeChange(window) {
134 const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage);
129135 let newOuterRect = window.get_frame_rect();
130136 let message = '%d×%d'.format(
131137 newOuterRect.width / scaleFactor,
245245 this._updateVisibility();
246246 }
247247
248 _setLongPressTimeout() {
249 if (this._longPressTimeoutId)
250 return;
251
252 const { longPressDuration } = Clutter.Settings.get_default();
253 this._longPressTimeoutId =
254 GLib.timeout_add(GLib.PRIORITY_DEFAULT, longPressDuration, () => {
255 delete this._longPressTimeoutId;
256
257 if (this._canOpenPopupMenu() && !this._contextMenu.isOpen)
258 this._openMenu(this._contextMenu);
259 return GLib.SOURCE_REMOVE;
260 });
261 }
262
263 _removeLongPressTimeout() {
264 if (!this._longPressTimeoutId)
265 return;
266 GLib.source_remove(this._longPressTimeoutId);
267 delete this._longPressTimeoutId;
268 }
269
270 vfunc_button_press_event(buttonEvent) {
271 if (buttonEvent.button === 1)
272 this._setLongPressTimeout();
273 return super.vfunc_button_press_event(buttonEvent);
274 }
275
276 vfunc_button_release_event(buttonEvent) {
277 this._removeLongPressTimeout();
278
279 return super.vfunc_button_release_event(buttonEvent);
280 }
281
282 vfunc_touch_event(touchEvent) {
283 if (touchEvent.type === Clutter.EventType.TOUCH_BEGIN)
284 this._setLongPressTimeout();
285 else if (touchEvent.type === Clutter.EventType.TOUCH_END)
286 this._removeLongPressTimeout();
287 return super.vfunc_touch_event(touchEvent);
288 }
289
248290 activate() {
249291 if (this.active)
250292 return;
390432 return;
391433 }
392434
393 if (button === 1)
435 if (!button || button === 1)
394436 this._minimizeOrActivateWindow(this.metaWindow);
395437 else
396438 this._openMenu(this._contextMenu);
636678 if (contextMenuWasOpen)
637679 this._contextMenu.close();
638680
639 if (button === 1) {
681 if (!button || button === 1) {
640682 if (menuWasOpen)
641683 return;
642684
00 project('gnome-shell-extensions',
1 version: '42.2',
1 version: '42.3',
22 meson_version: '>= 0.53.0',
33 license: 'GPL2+'
44 )