Skip to content
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

Placement is wrong under wayland #5

Closed
fmoralesc opened this issue Nov 14, 2016 · 15 comments
Closed

Placement is wrong under wayland #5

fmoralesc opened this issue Nov 14, 2016 · 15 comments
Labels

Comments

@fmoralesc
Copy link

It seems like Gtk can't handle the parenting of the window properly.

captura de pantalla de 2016-11-14 13-23-34

@p-e-w p-e-w added the bug label Nov 27, 2016
@jhasse
Copy link

jhasse commented Mar 6, 2017

Mutter 3.22.2 fixes "various placement issues on wayland", see https://mail.gnome.org/archives/gnome-shell-list/2016-November/msg00002.html

Can you try if this still happens?

@fmoralesc
Copy link
Author

I just tried with 3.22.3 and it still happens.

@trgeiger
Copy link

I can confirm that this also happens under Mutter 3.24.1
screenshot from 2017-04-15 10-12-38

@p-e-w p-e-w closed this as completed in d52b395 Apr 23, 2017
@p-e-w
Copy link
Owner

p-e-w commented Apr 23, 2017

Since Wayland apparently does not support CENTER_ON_PARENT at all (you can see the same issue in many GNOME core apps, e.g. the preference dialog in Gedit), I decided to make the popup window modal.

This matches the behavior of Atom's command palette and solves this and several other Wayland issues.

@fmoralesc
Copy link
Author

This seems to break placement of plotinus in Xorg, though :/

@p-e-w
Copy link
Owner

p-e-w commented Apr 23, 2017

@fmoralesc: How? Modal windows work the same across Xorg and Wayland (at least all others do).

Can you provide a screenshot of what you are seeing?

@fmoralesc
Copy link
Author

I would have supposed so, but this is what I see...
captura de pantalla de 2017-04-23 17-48-44

It works perfectly in wayland, though (This is using mutter 3.24.1)

@p-e-w
Copy link
Owner

p-e-w commented Apr 23, 2017

What desktop is this?

What happens when you open a standard modal dialog (e.g. Nautilus' "About" dialog)?

@fmoralesc
Copy link
Author

This is Gnome 3.24.

The 'About' dialog is centered. I also considered whether something in my config was wrong... (There is the /org/gnome/mutter/attach-modal-dialogs key that could affect this, but it doesn't seem to make any difference here...)

captura de pantalla de 2017-04-23 18-01-38

@p-e-w
Copy link
Owner

p-e-w commented Apr 23, 2017

Does adding back the line

window_position = Gtk.WindowPosition.CENTER_ON_PARENT;

that was removed by the commit fix the issue?

I also notice a font issue in your first screenshot. The arrow symbol that is used to separate menu hierarchy levels appears to have been substituted by a placeholder of sorts. What is your UI font?

Beautiful desktop, by the way! 👍

@fmoralesc
Copy link
Author

(Thanks!) My UI font is Roboto (the Android font). With DejaVu Sans I get a clearer arrow (in Roboto it is an arrow surrounded by a circle).

With that line, it improves, I get
captura de pantalla de 2017-04-23 18-19-27

It still doesn't seem to behave as a modal window.

@p-e-w
Copy link
Owner

p-e-w commented Apr 23, 2017

Looks like this needs deeper investigation. I hope this doesn't indicate a limitation for GTK+ modules somehow. The placement is weird, it's vertically centered but not horizontally.

Thank you very much for your help so far!

@fmoralesc
Copy link
Author

No problem, thanks to you for this software!

@p-e-w
Copy link
Owner

p-e-w commented Apr 29, 2017

@fmoralesc: The Xorg issue is now fixed!

This was a tough nut to crack. Eventually I noticed that the problem disappeared when I made PopupWindow inherit from Gtk.Dialog instead of Gtk.Window (though that introduced other problems). In https://github.com/GNOME/gtk/blob/master/gtk/ui/gtkdialog.ui I then found the key missing property:

type_hint = Gdk.WindowTypeHint.DIALOG;

Of course, the whole thing still reeks of a GTK+ bug, but at least it's working now in both Wayland and X11!

@fmoralesc
Copy link
Author

Awesome! I can confirm it is fixed now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants