[sorry for the long delay] * martin rudalics Wrote on Sat, 11 Sep 2021 10:38:12 +0200 [snip] > > No, I couldn't figure out how to make raise-frame (select a different > > frame and set input focus) work on mutter-wayland with gtkonly emacs. > > `raise-frame' calls Fmake_frame_visible. Are advices not working when > called from C? Anyhow, you should try to do those advices in C in the > first place - that's what I tried in the patch I sent to Dmitry and it > works for `raise-frame' here (but causes havoc under xfwm). > > > gdk's calls do not work. > > In general? We do use them all the time. No, just for raising the window. The problem was in the pgtk branch: select-frame-set-input-focus would not select the frame raise it and set the input focus. > > I think that's being punted, and relief is expected from some > > "xdg-activation protocol" > > Has that been implemented already? The pgtk branch should probably > know about it first. I couldn't spot it, but there is apparently a workaround for gtk3, mentioned in the issue "Allow raising application accessory windows under Wayland (#730)" https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/730 (needs javascript) a solution is mentioned by @chergert (3 years ago) "Okay, so this appears to work fine to raise the secondary window if i just fake the timestamp. Not what I want to do, but it means that plumbing can support this just fine (which I thought was broken)." which for him meant, instead of using gtk_window_present(), to instead use #+BEGIN_SRC /* TODO: We need the last event time to do this properly. Until then, * we'll just fake some timing info to workaround wayland issues. */ gtk_window_present_with_time (window, g_get_monotonic_time () / 1000L); #+END_SRC (from gnome-builder/src/libide/gui/ide-gui-global.c) Implementing that in pgtk with the attached patch seems to work. To test: emacs -Q -l test.el (setq $a (make-frame)); move the new frame out of the way and ;; go back to the first frame. (select-frame-set-input-focus $a) ;; after the patch this sets the input focus - on mutter 41 the cursor ;; is still over the old window I'm hoping a pgtk user can test this/comment on if this is a right approach? ---Madhu https://bugzilla.redhat.com/show_bug.cgi?id=1349225