-
-
Notifications
You must be signed in to change notification settings - Fork 999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hard to resize windows when using CSD #3427
Comments
This is already fixed in the csd branch, where the window decorations |
Ah, thanks! I just tried out that branch and this particular issue seems to be fixed there. However I found a few other issues when using that branch, but I assume that's because it's still WIP. I'll be happy to test it again and report whatever issues I find, as soon as you consider it ready for external input. |
Feel free to pint out any issues you notice. I am, at best, peripherally |
On Wed, Mar 31, 2021 at 10:26:37AM -0700, Tobias Guggenmos wrote:
> I am, at best, peripherally interested in CSD.
Well, thanks for working on it anyway, then.
Here are some things I noticed.
* Compiling with GCC 11.0.1 fails, clang 12.0.0 compiles fine.
Fails with what error?
* The completely white decorations are invisible, when the window is in front of a white background.
![image](https://user-images.githubusercontent.com/15368509/113185342-9fc0fd80-9256-11eb-875a-e144d0484806.png)
I suppose adding a gradient would be easy enough.
* the `hide_window_decorations` configuration options doesn't do anything.
This is not implemented. Why would anyone want to do this for only one
window type in their system? Still I suppose implementing it is not too
difficult.
* The behavior of hiding the side and bottom window decorations when the window isn't focused looked a bug at first, but the commit messages hint that this might be intended behavior. If this is kept, maybe it shouldn't be default behavior.
That's a placeholder, ideally colors should change.
* Since the CSDs are probably mainly going to be used with GNOME, it might make sense to use a similar style than GNOME Terminal, i.e. very thin borders combined with shadows and rounded corners:
I'm afraid rendering shadows is enough of a pain that I am not
interested, but patches are most welcome. Should be fairly easy. Just
re-implement render_edge() to render the shadow to an ARGB bitmap. All
you need to touch is a single function. There is example code for
rendeing shadows here: https://gitlab.gnome.org/jadahl/libdecoration/-/blob/master/src/plugins/cairo/libdecor-cairo.c
it uses libcairo, but not in any sophisticated way, so should
be easy to implement without it.
…
GNOME Terminal focused:
![image](https://user-images.githubusercontent.com/15368509/113184786-ea8e4580-9255-11eb-8f19-694feea34ad8.png)
GNOME Terminal unfocused:
![image](https://user-images.githubusercontent.com/15368509/113184906-0bef3180-9256-11eb-95cc-7be184f6b9f9.png)
--
You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub:
#3427 (comment)
--
_____________________________________
Dr. Kovid Goyal
https://www.kovidgoyal.net
https://calibre-ebook.com
_____________________________________
|
This one
A solid light gray would work, too. Thats what alacritty does.
I mainly tried this option out, since the empty decorations weren't really useful. But I won't use that option, when CSDs work properly.
Thanks for the hint. I might look into that, but I won't get to it until in a few weeks or so. |
This work has been merged to master. Titles are now displayed, and the |
Well, thanks for going trough that pain anyway! |
Well, I learned a bit more about wayland, so not totally a waste. And to be fair 75% of the stuff in kitty I dont use personally anyway. |
Note that I added support for shadows. Please test, things seem to work fine in mybrief testing on GNOME. The quality of the shadows could possibly be improved by playing with the gaussian parameters, I leave that as an exercise to the reader. |
Oh, thanks. I tried it out today and while the shadows are fine, there seems to be a newly introduced bug that resizes the window when it is tiled to the left and then unfocused. I think the screencast explains it better than words could: Screencast.from.04-06-2021.01.54.00.PM.mp4 |
Doesnt repro for me, do you have some steps I can try. Also I doubt this |
I
Regarding reproduction:
|
Those steps dont reproduce for me, fee free to play with the numbers its line 401-403 in wl_client_side_decorations.c since you can repro maybe you can figure out what the numbers should be. If that is indeed the problem then simply commenting out line 405 will fix it, but then gnome will treat the shadows as part of the window for positioning purposes. |
See is this fixes it: f849f38 |
Nope, that doesn't fix it. I tried to debug the issue myself and it turned out, that the |
But with that commit the upper half of the top decoration isn't visible when the window is maximized, since it's positioned a bit too high. |
And it turns out the kitty window also umaximizes itself when I first maximize it and then switch to another window. I guess that's the same underlying problem. |
The documentation for
My best guess is that some of the handling necessary when tiling/maximizing is done by the compositor, until that function is first called. After that, kitty has to do it itself, which it possibly didn't do so far. |
On Tue, Apr 06, 2021 at 10:34:22AM -0700, Tobias Guggenmos wrote:
And it turns out the kitty window also umaximizes itself when I first maximize it and then switch to another window. I guess that's the same underlying problem.
kitty never un maximizes itself unless you press the shortcut to toggle
maximization. Easily verified by grepping the source code for
xdg_toplevel_unset_maximized and adding a printf there.
|
On Tue, Apr 06, 2021 at 10:56:12AM -0700, Tobias Guggenmos wrote:
The documentation for `xdg_surface_set_window_geometry` says:
```
* Once the window geometry of the surface is set, it is not possible to
* unset it, and it will remain the same until set_window_geometry is
* called again, even if a new subsurface or buffer is attached.
```
My best guess is that some of the handling necessary when tiling/maximizing is done by the compositor, until that function is first called. After that, kitty has to do it itself, which it possibly didn't do so far.
There is no concept of tiling in wayland for kitty to take care of. And
as far as maximization goes, the way it works is either the compositor
initiates it via a configure event or the application requests it and
the compositor changes the state and sends it to the application in the
next configure event. In either case the application handles the change
in the configure event.
|
This looks like a bug in GNOME. Add a printf() to line 428 in printf("maximized: %d fullscreen: %d activated: %d width: %d height: %d\n", maximized, fullscreen, activated, width, height); and you will see the compositor sending configure events with new sizes It does this for me even when the window is not maximized/tiled and And I was wrong earlier, the xdg_toplevel spec apparently implements tiled |
Aaah, I think I figured it out. From the docs for the configure event
Am guessing GNOME expects windows to interpret the width and height as Such a poorly thought out mechanism, typical for Wayland. It isnt |
Should be fine now. At least on my system I cant see any problems. Switching focus does not change the window size. GNOME seems to get the correct content area size for the window, as can be verified by moving the mouse to the top left corner of the screen to trigger window selection mode, then hovering over the kitty window and observing that the window selection border is correctly drawn over the content area excluding the shadows. |
That's more or less what I did yesterday.
I'm beginning to understand why you hate it.
Well, the spec declares those tiled states, However,
I guess it is. I also couldn't find any applications that implement shadows without using cairo or GTK, so maybe they're just not worth it. |
Oh, and I forgot to mention that the resizing issue still persist for me, even with the latest commits. |
Some debug logs, comment (using top-level configure event: size: 0x0 states:
final window content size: 977x815
GL version string: '4.6 (Core Profile) Mesa 21.0.1' Detected version: 4.6
top-level configure event: size: 977x839 states: TOPLEVEL_STATE_ACTIVATED
final window content size: 977x815
top-level configure event: size: 977x839 states:
final window content size: 977x815
top-level configure event: size: 977x839 states: TOPLEVEL_STATE_ACTIVATED
final window content size: 977x815
[097 15:50:31.014789] No render frame received in 0.25 seconds
# This should have included a tiled state
top-level configure event: size: 1280x1400 states: TOPLEVEL_STATE_ACTIVATED
# This is reported wrong by kitty. Moving the respective debug() statement down two lines gives a correct number.
final window content size: 977x815
# Now the unfocus happens. The size sent by the compositor is just wrong
top-level configure event: size: 989x851 states:
final window content size: 1280x1376
top-level configure event: size: 989x851 states: TOPLEVEL_STATE_ACTIVATED
final window content size: 989x827
[097 15:50:48.999765] No render frame received in 0.25 seconds
top-level configure event: size: 1280x1400 states: TOPLEVEL_STATE_ACTIVATED
final window content size: 989x827
top-level configure event: size: 1280x1400 states: TOPLEVEL_STATE_ACTIVATED
final window content size: 1280x1376
top-level configure event: size: 977x839 states: TOPLEVEL_STATE_ACTIVATED
final window content size: 1280x1376
# Maximizing and unfocusing the window gives similar results.
top-level configure event: size: 2560x1400 states: TOPLEVEL_STATE_MAXIMIZED TOPLEVEL_STATE_ACTIVATED
final window content size: 977x815
top-level configure event: size: 989x851 states: TOPLEVEL_STATE_MAXIMIZED
final window content size: 2560x1376 |
Hmm am at a loss. I made one final commit, which should prevent the size changing in dispatchChngesAfterConfigure() maybe that will help. 82a5733 but without being able to reproduce... BTW what scale are you using, my system has scale = 2 it maybe we are seeing different behavior because of that, only thing I can think of. |
Right now scale=1, when I have an additional screen, scale=1 on one an scale=2 on another screen. What version of GNOME are you using? I'll try to use an older version, to see if it's a newly introduced GNOME bug. |
I tried with scale=2 and the bug still exists there. |
On Wed, Apr 07, 2021 at 07:37:01AM -0700, Tobias Guggenmos wrote:
> BTW what scale are you using
Right now scale=1, when I have an additional screen, scale=1 on one an scale=2 on another screen.
What version of GNOME are you using?
40.0.0
|
On Wed, Apr 07, 2021 at 07:38:08AM -0700, Tobias Guggenmos wrote:
I tried with scale=2 and the bug still exists there.
Does it happen with only a single monitor?
|
Yes.
I use the same version. So using an older one probably won't help. |
Hmm, well I am at a loss... |
Interestingly I just updated my system, GNOME version according to the |
Easy enough to workaround the regression in GNOME once I could |
Maybe it was a mutter update. Anyway, great that it works now! |
Describe the bug
When using the client side Wayland decorations (see #3284), grabbing one of the bottom corners of the window to resize it requires pixel perfect positioning of the mouse pointer to be able to change both width and height of the window.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
There should be some tolerance for grabbing those corners, i.e. if the pointer is a few pixels off it should still work.
Screenshots
If applicable, add screenshots to help explain your problem.
Unfortunately, GNOME Screenshots don't capture the pointer, so getting a meaningful screenshots here doesn't work.
Environment details
OS: Fedora 34 / GNOME 40
Additional context
Try to reproduce the problem with
kitty --config NONE
if you cannot then post a minimal kitty.conf that reproduces the problem. If the problem involves interaction with some other terminal program post a minimal config for that program to reproduce the problem as well.The text was updated successfully, but these errors were encountered: