Skip to content

Commit be5ac10

Browse files
committed
prefs: Swap window width/height when switching window position
The settings change happens correctly, but for some reason the UI does not reflect the change.
1 parent 97c77ec commit be5ac10

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

ddterm/shell/geometry.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,16 @@ export const WindowGeometry = GObject.registerClass({
238238
this.notify('pivot-point');
239239
}
240240

241+
_swap_window_sizes() {
242+
var hsize = this.window_hsize;
243+
this.window_hsize = this.window_vsize;
244+
this.window_vsize = hsize;
245+
// TODO: Is this right?
246+
this.notify('window-hsize');
247+
this.notify('window-vsize');
248+
this.notify('target-rect');
249+
}
250+
241251
_set_orientation(new_orientation) {
242252
if (this._orientation === new_orientation)
243253
return;
@@ -320,12 +330,18 @@ export const WindowGeometry = GObject.registerClass({
320330
switch (this.window_position) {
321331
case Meta.Side.LEFT:
322332
case Meta.Side.RIGHT:
333+
if (this._orientation !== Clutter.Orientation.HORIZONTAL)
334+
this._swap_window_sizes();
335+
323336
this._set_orientation(Clutter.Orientation.HORIZONTAL);
324337
this._set_maximize_flag(Meta.MaximizeFlags.HORIZONTAL);
325338
break;
326339

327340
case Meta.Side.TOP:
328341
case Meta.Side.BOTTOM:
342+
if (this._orientation !== Clutter.Orientation.VERTICAL)
343+
this._swap_window_sizes();
344+
329345
this._set_orientation(Clutter.Orientation.VERTICAL);
330346
this._set_maximize_flag(Meta.MaximizeFlags.VERTICAL);
331347
}

0 commit comments

Comments
 (0)