linuxmint / cinnamon

A Linux desktop featuring a traditional layout, built from modern technology and introducing brand new innovative features.
GNU General Public License v2.0
4.53k stars 735 forks source link

When a window is pinned to the side of a screen, maximizing will sometimes maximize in the other screen. #8717

Open crsaracco opened 5 years ago

crsaracco commented 5 years ago

I don't think syslog and .xsession-errors are needed here (I think it's a logic bug instead of an error), but I can attach them upon request.

Issue

I'm currently running a two-monitor setup.

When I pin a window to one side of a monitor [1] and click the "maximize" button, the window will sometimes maximize in the other monitor (the monitor that it's currently not half-maximized in).

I assume this might have something to do with the window not updating which monitor it's being displayed on when you click and drag to pin it, but I haven't dug into the code to confirm.

[1]: I'm not sure what the correct Cinnamon terminology is here, but I drag the window with my mouse all the way to the left or right of a monitor until it maximizes in half of the screen.

Steps to reproduce

  1. On a two-monitor setup (one monitor to the left, and one monitor to the right), open a new unmaximized window on the left monitor. (could be gnome-terminal, for example)
  2. Pin the window to the left side of the right monitor, so that it's half-maximized on the left side of that monitor.
  3. Click the maximize button. For me, this results in the window (sometimes?) being maximized on the left monitor.

Expected behaviour

The window should maximize on the right-side monitor.

icarter09 commented 4 years ago

@crsaracco are you still experiencing this issue?

crsaracco commented 4 years ago

I remember seeing it fairly recently, either yesterday or the day before. I'll update Cinnamon as far as I can (on Arch) this weekend and double-check.

icarter09 commented 4 years ago

@eli-schwartz

crsaracco commented 4 years ago

Yep, still happens. Here's a repro: https://www.youtube.com/watch?v=EWKTURVdZ9A

It doesn't seem to happen 100% consistently, but it's consistent enough that I knew it had a good chance of happening on that fourth case I tried, after trying it a few times pre-recording.

$ cinnamon --version
Cinnamon 4.2.4
KaiDaCanadian commented 3 days ago

Figured out how to reproduce something very similar to this 100% of the time I say very similar, because this happens upon unmaximizing a window, not maximizing it.

Here's a video: https://youtu.be/zDB7Y4grsZc

$ cinnamon --version
Cinnamon 6.0.4

Now that I think about it, this seems like intentional behavior. Windows will 'remember' where you initially dragged them, and will return to that position upon unmaximizing them (hence the terminal always returning specifically to the bottom right of Monitor B). While this is fine on its own, I think windows shouldn't be able to jump across monitors by default, as this causes confusion and jank, especially when watching youtube and stuff.

Instead, by default, windows should remember their relative offset to its initial monitor, and return to that position on the monitor it was dragged to. So in the case of the video, the terminal should unmaximize to the bottom right of Monitor A, rather than Monitor B.

This could be a completely different issue than what OP experienced, I'm not sure