jnsh / arc-theme

A flat theme with transparent elements (actively maintained fork)
GNU General Public License v3.0
900 stars 77 forks source link

GNOME 40: vertical shift in Alt+Tab switcher with long window titles #129

Closed drakkar1969 closed 2 years ago

drakkar1969 commented 3 years ago

Thanks for the quick update for GNOME 40!

Just noticed a small glitch in Alt+Tab switcher, only seems to happen with "long" window titles:

ezgif-3-4652c7907d81

jnsh commented 3 years ago

Thanks for the report.

That is not the regular Alt+Tab switcher though, as by default it should look something like this: screenshot

I think I've seem switcher looking like that before, but can't remember whether it's an extension or some well hidden option? Also, does the shift happen with the default shell theme?

drakkar1969 commented 3 years ago

Not an extension, just inverted the switch-applications and switch-windows keyboard shortcuts:

gsettings set org.gnome.desktop.wm.keybindings switch-windows "['<Alt>Tab', '<Super>Tab']"
gsettings set org.gnome.desktop.wm.keybindings switch-windows-backward "['<Shift><Alt>Tab', '<Shift><Super>Tab']"
gsettings set org.gnome.desktop.wm.keybindings switch-applications "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward "[]"

Also a small bug in the default shell theme, where there is a 1px difference in the height of the switcher with long window tiles (but no vertical shift of the thumbnails):

ezgif-5-7d911c6f497b

EDIT: actually, looking at the last screencast, it seems more related to the double arrow glyph in the VSCodium window title than the length of the window title ...

jnsh commented 3 years ago

EDIT: actually, looking at the last screencast, it seems more related to the double arrow glyph in the VSCodium window title than the length of the window title ...

I was also wondering whether this could result from certain glyphs rather than long titles, since I wasn't able to reproduce this myself.

I think this is technically an upstream issue in gnome-shell, as the switcher size also increases with the default theme. Although I agree that the switcher size increasing upwards with Arc is much more noticeable especially with the thumbnails moving. However, I can't think of anything in the stylesheets that could explain the different behaviors.

Since I'm quite busy with other things and don't have a way to reproduce it, I doubt that I can investigate this further at this time. After all it is a relatively minor and rarely occurring glitch.

If you want to investigate this yourself, one thing you could try is whether if the padding in .switcher-list, or the box-shadow in %shell_bg in Arc stylesheet have any effect on this. Those are the only real differences I noticed between Arc and the default theme anyway...

drakkar1969 commented 3 years ago

After some investigation, this is caused by the padding property in .switcher-list:

.switcher-list {
  padding: 15px;
  @extend %shell_bg;
...
}

Changing the padding value to the upstream value of 12px prevents the thumbnail vertical shift. Happy to submit a PR, if you are ok with the change

jnsh commented 3 years ago

Thank you for testing!

I really wouldn't like to change the switcher padding, as it it would be a noticeable visual change. The current .switcher-list padding is roughly equivalent with the workspace-switcher padding, so the change would make them look inconsistent. Also the padding effects the .switcher-arrow size, and reducing the padding even by 1px seems to make the arrow smaller.

Also, I'm not sure whether padding is really the culprit here, since there's really no direct reason why it would result in this behavior. My guess is that the problem results from how the gnome-shell calculates the vertical alignment for the switcher popup. When the popups height increases, it may appear to enlarge either downwards or upwards (resulting in the vertical shift on thumbnails) depending on its initial height, as gnome-shell attempts to retain its vertical alignment.

The related gnome-shell code gets a bit too complicated for me to follow, so this is only a speculation. However, if I'm correct, e.g. different font scaling factors would probably change the behavior just as much as the padding change does.

Would you mind testing this with various different font scaling factors, to see if that changes anything?

If my above guess is correct, I don't think there's anything that could be done from the theme unfortunately. The gnome-shell code would have to be changed to ensure that if the switcher popup's size changes, it would only grow downwards.

drakkar1969 commented 3 years ago

Does indeed vary with different font scaling:

I can see why you wouldn't want to change the padding, especially given the different behaviors with different font scaling

jnsh commented 3 years ago

Thanks for testing with different font scaling. I think that means I'm not too far off in my guess for why this happens.

I'd imagine the behavior would vary similarly between font scaling factors when using the default shell theme as well. If that's the case, you could report this as an upstream bug. I'm fairly certain there's nothing that could be done in the theme to fix this, since the behavior depends on the font size.

jnsh commented 2 years ago

This was left open in case of further comments. I think it was established, that this wasn't directly related to Arc, and I still don't think there's anything that could be done to fix this within the theme.

Therefore I'm closing this. Feel free to continue discussion, or request reopening, if there's anything to add :)