Smithay / wayland-window

A simple window-decorations library built on top of wayland-client.
MIT License
18 stars 11 forks source link

Issues on Debian 9 with Gnome 3 #23

Closed newpavlov closed 6 years ago

newpavlov commented 6 years ago

I have observed two issues with simple_window example on Debian: 1) set_title has no effect, created window is named as "null"/"Unknown application". 2) When resizing window using top/left border or top-left corner the opposite borders jump randomly, resizing with bottom/right borders work without problems.

elinorbgr commented 6 years ago

Thanks for this report.

  1. This is weird, this method is just a direct wayland message, without any magic from wayland-window... Does adding a call to set_class change anything? (like adding decorated_surface.set_class("org.test".into()) just after the set_title)

  2. Indeed, I can reproduce it on weston, interestingly it only jumps like that if the first resize is done from top/left. If I resize from bottom/right first then from top/left, it works correctly. Is it the same for you?

newpavlov commented 6 years ago

1) Name of the window becomes "org.test", if I change this line to decorated_surface.set_class("my example window".into()) it sets window name to "my example window", so it looks like set_title has no visible effect. 2) No, for me even if I resize bottom/right first it continues to jump.

elinorbgr commented 6 years ago
  1. Hmm, do you have the weston example apps to compare with? If you start weston-terminal, does it get a correct title?

  2. Ah, I see. This might be the same issue showing itself differently on weston and mutter though...

newpavlov commented 6 years ago

1) No, how can I get it?

elinorbgr commented 6 years ago

I believe it should come with weston if you install it.

newpavlov commented 6 years ago

weston-terminal results in "Unknown application" too, so it seems Gnome displays at the top name of the program (which is set by set_class), and title is used only when switching between windows (e.g. by using Alt+`) or in overview mode (after moving cursor to top left corner of display).

Different problem is that when I use winit (with build_vk_surface) it looks like with_title on WindowBuilder has no effect (i.e. it does not show title in overview mode) and I can't find a way to call set_class. Should I report it in winit repo?

UPD: But if I'll use window.window().set_title("My title") it works.

elinorbgr commented 6 years ago

set_class actually refers to changing the class/app_id in a freedesktop sense: it should be an identifier matching the .desktop file associated with a program. Once it's found the associated file, Gnome uses it to infer the program name, icon, and some metadata. Apparently, if the file is not found, it fallbacks to naming the program with the content of the supplied "class"...

This distinction between class/title is interesting, and winit should clearly take it better into account. I'm going to try and find a better explanation of the behavior of Gnome and freedesktop files in general.

elinorbgr commented 6 years ago

Regarding the jumping around issue, I've been working on a full refactor of the lib, mostly changing the way decorations are drawn, this is pending in #24 . Do you think you can test those changes in your system and see if it has any impact on that issue?

newpavlov commented 6 years ago

On Gnome 3.27.92 I still get small jumps in the small_window example when I release button after resizing with top-left corner. Also in my toy application for web cam visualization written with Vulkano v0.9 (it uses wayland-window v0.13.2) I still get large jumps.

elinorbgr commented 6 years ago

Closing as this library is to be replaced by Smithay's Client Toolkit.

The border drawing mechanism has been reworked, this may or not have fixed the bug. If not, it may be related to https://github.com/Smithay/client-toolkit/issues/2.