linuxmint / mint21-beta

BETA Bug Squash Rush
16 stars 3 forks source link

muffin: Docking a window on the left or right half of your screen, closing the window, then relauching it has it always reappears a bit off from the left side #139

Closed NintendoManiac64 closed 2 years ago

NintendoManiac64 commented 2 years ago

(tested in a live session of Cinnamon as well as a fully-updated local installation as of 2022-07-15... though I suppose that's a bit outdated now)

When you dock any resizable program window on the left or right half of the screen, close the window, then re-open it, it'll always appear a little bit off from the left side (even if you had docked it on the right side of the screen).

To Reproduce

  1. boot Mint 21 beta Cinnamon
  2. open a program (Nemo, Firefox, xed...)
  3. dock it on the left half of the screen
  4. close the program window
  5. re-open the program that you opened in step 2
  6. observe how the window reappears a bit off from the left side
  7. now dock the program window on the right half of the screen
  8. close the program window
  9. re-open the program that you opened in step 2
  10. observe how the window still reappears a bit off from the left side

Expected behavior I would think that there are three different possibilities that could be counted as "expected behavior":

Screenshots screenshot

Additional context It may be worth noting that Xfce with the same equivalent programs (Thunar, Firefox, xed) has kind of similar window positioning issues but to what seems to be a much more major degree to the point that I'm having difficulty finding consistency in its wonky behavior (especially when maximizing, docking into a screen-half, and/or docking into a screen-corner, then subsequently closing and re-opening the window). I figured that I would eventually make a bug report at some point specifically for that... but I have a long list of other bugs that I've previously recorded to get through reporting first.

mtwebster commented 2 years ago

These aren't issues, but expected behavior:

We can change the default position back to 'center new windows', but personally I think what we have now is superior. This is all the same behavior as previous Cinnamon versions, the only difference being this center option's default setting.

NintendoManiac64 commented 2 years ago

personally I think what we have now is superior

I think the current behavior is fine for windows that were previously docked on the left side but I really don't understand the logic for the current behavior if the window was docked on the right side.

JosephMcc commented 2 years ago

It works that way because that is the default place for them to open. If a window doesn't remember where it previously was, there is nothing to be done about it. This isn't under our control. I think mtwebster explained it pretty well. Different applications handle these things differently and that's sort of what we are stuck with.

NintendoManiac64 commented 2 years ago

It works that way because that is the default place for them to open. If a window doesn't remember where it previously was, there is nothing to be done about it.

...wait, isn't the center the default place for windows to open though? Not a little bit off from the left side?

JosephMcc commented 2 years ago

The position in the upper left corner is default new-window-position behavior. If you subsequently launch another window/instance of that program, it gets offset from the previous one, in a cascade effect, which I think is pretty nice. You can have new windows centered instead (Window settings -> behavior -> "center new windows") which was the behavior in previous Cinnamon versions, but if you launch multiple windows, they cover the previous ones exactly - there's no staggering.

As said by mtwebster

NintendoManiac64 commented 2 years ago

As said by mtwebster

Then why is it that, if I boot a live session of Mint 21 beta Cinnamon and double-click on the "Home" icon on the desktop, the resulting Nemo folder view opens in the center of the screen, not on the left side?

mtwebster commented 2 years ago

If there's nothing on the monitor, or most of the monitor is empty, it will center it in that space rather than cascading - because there's no need to.

Open a second window after that first.

NintendoManiac64 commented 2 years ago

Well then doesn't this go back to my initial reply that I don't understand the current behavior for windows that were previously docked, particularly on the right side? It's putting them a bit off from the left even when there are no other windows open.

EDIT: ...and it seems that it actually keeps doing this if you close and re-open the program (e.g. Nemo) even after moving the window, and it won't put it back to center unless you maximize, close, re-open, un-maximize, close again, then re-open again.

Are we sure this isn't a bug?

EDIT 2: ...and it seems that windows docked on the top or bottom half, when closed and re-opened, also always appear on the top half of the screen rather than centered.

fredcw commented 2 years ago

There still seems to be some inconsistencies with Nemo windows (also Xed appears to have the same inconsistencies)

Position of window when closed   | Position of window when reopened
-------------------------------------------------------------------------
Top half docked or               | Top half undocked (whether other windows open or not)
Bottom half docked               | 

Left half docked or              | Cascaded (same size) (whether other windows open or not)
Right half docked                |

Any corner docked or             | Cascaded same size (when other windows open) or
anywhere else undocked           | Centered same size (when no other windows open)

(except top half undocked after  | Top half undocked
previously being docked)         | 

@NintendoManiac64 "a bit off from the left" as you put it is actually cascaded style except that the window is shifted up to fit it on the screen.

mtwebster commented 2 years ago

If the window is large enough, it gets in its own way and breaks the 'single window centering' case. This is why full side tiling is behaving differently than corner tiling.

Here you go: https://github.com/linuxmint/muffin/blob/master/src/core/place.c#L662

It does its best, nothing is perfect. Someone could certainly add a dozen more tests for various corner (no pun intended) cases, but there's no bug here.

NintendoManiac64 commented 2 years ago

Huh, good to know. I guess I'll redirect my window-positioning inspections towards trying to figure out the wackiness with Xfce program windows (Thunar, xed, etc) since, as previously mentioned, they're... a bit of a mess when maximizing and/or docking comes into play.