3

I use gtk3 and gtkmm. I want to move a window on wayland.

Hoever it doesn't seem to be possible. I tried using Gtk::Window::move method and Gdk::Window::move method. I also set type_hint on Gtk::Window and called Gtk::Window::set_transient_for. None of these worked on wayland, it just doesn't move. And also calling Gtk::Window::set_transient_for on the "child-window" makes my TYPE_HINT_DIALOG "child-window" not stay above the main-window anymore, which worked before calling this method.

I read however this in the gtkmm: Gdk::Window Class Reference:

For toplevel windows, window managers may ignore or modify the move; you should probably use gtk_window_move()1 on a Gtk::Window widget anyway, instead of using GDK functions. For child windows, the move will reliably succeed

It says moving child windows works. But I doen't know exaclty what it means by "child windows".

Now I want to know:

  1. Is this true?
  2. How can I make a certain window a child-window of another window in order to move the child window (and is Gtk::Window::set_transient_for the way to go)?
  3. Can I somehow yet move (toplevel) windows with gtk on wayland (with e.g. subsurface or something else)

Note: C-code (gtk-code) is also welcome!

Edit: Just want to note: With Qt5 using app-option "-platform wayland" it's the same. Qt5 doesn't move windows when using wayland.


1 I guess this is an error and it should be Gtk::Window::move(int x, int y)

5
  • Well, have you tried it and what happens? Questions like this get downvotes pretty quick.
    – theGtknerd
    Jan 18, 2018 at 12:26
  • @theGtknerd thanks for this tip, I added what I tried so far. Jan 18, 2018 at 12:31
  • Could you try a different window manager? I assume this is the problem. If you post an MCVE, I could see if I can duplicate your problem.
    – theGtknerd
    Jan 18, 2018 at 17:44
  • 1
    @theGtknerd you are right, with Xorg it works. However I'd also like to get it working with wayland. I guess with gnome3 there might be many people using wayland. Jan 19, 2018 at 7:33
  • Are you using the same window manager, but switching between Wayland and Xorg? In that case, I would file a bug on Bugzilla.
    – theGtknerd
    Jan 19, 2018 at 11:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.