Properly raise windows on activation
This is a quick PoC to implement the necessary bit of gtk-shell to fix #93 (closed) for window activation (since the upstream protocol discussion seems to take way longer and so we can safe implementing the toolkit part until this is settled in).
Can be desktop on desktop by e.g. lanunching gedit
, selecting help
form the menu, putting the help window in the background and seleting help again. The functions used there are the same as e.g. when contacts
talks to chatty
.
This is leaky, i'll clean this up over the next days.
Closes: #93 (closed)
Merge request reports
Activity
mentioned in issue #93 (closed)
Would be nice to get this in since besides filling the preview window (phosh#136 (closed)) and compositor global gestures (#82,) this is one of the major usability killers on the phone.
mentioned in issue chatty#249 (closed)
- src/gtk-shell.c 0 → 100644
13 #include "desktop.h" 14 #include "gtk-shell.h" 15 16 /** 17 * SECTION:phoc-gtk-shell 18 * @short_description: A minimal implementeation of gtk_shell1 protocol 19 * @Title: PhocGtkShell 20 * 21 * Implement just enough to raise windows for GTK based applications 22 * until there's an agreed on upstream protocol. 23 */ 24 25 static void 26 handle_set_dbus_properties(struct wl_client *client, 27 struct wl_resource *resource, 28 const char *application_id, added 6 commits
Toggle commit listenabled an automatic merge when the pipeline for 76b5db6d succeeds
Just sat down to review it and got surprised when pull on master already got these commits in... ;)
Anyway, looks good at first glance, although I already started getting rid of
view->type
switches across the code base and there's only a few left, so I'd rather have that implemented by particular view types instead of introducing yet another one. FWIW, theroots_view_get_from_wlr_surface
helper will make !106 (merged) cleaner as well.sorry about that then, i saw you active on matrix the last days but on here so i figured i put that in since it bumps up usability quite a bit over here (and rather hold off the release a couple more days !117 (merged)) so people can test on the devkit. I saw your
view->type
removal and agree but as written int the commit it'd rather do that more when there's proper gobject interfaces (and it's local to a single function so will be easy to clean up).Hmm... but is this type checking actually needed there? I just tested:
diff --git a/src/view.c b/src/view.c index aa6e949..27ef80c 100644 --- a/src/view.c +++ b/src/view.c @@ -959,35 +959,13 @@ roots_view_get_from_wlr_surface (struct wlr_surface *wlr_surface) { PhocServer *server = phoc_server_get_default (); PhocDesktop *desktop = server->desktop; - struct roots_view *view, *found_view = NULL; + struct roots_view *view; wl_list_for_each(view, &desktop->views, link) { - switch (view->type) { - case ROOTS_XDG_SHELL_VIEW: { - struct roots_xdg_surface *xdg_surface = - roots_xdg_surface_from_view(view); - if (xdg_surface->xdg_surface->surface == wlr_surface) - found_view = view; - break; - } - case ROOTS_XDG_SHELL_V6_VIEW: { - struct roots_xdg_surface_v6 *xdg_surface_v6 = - roots_xdg_surface_v6_from_view(view); - if (xdg_surface_v6->xdg_surface_v6->surface == wlr_surface) - found_view = view; - break; - } -#ifdef PHOC_XWAYLAND - case ROOTS_XWAYLAND_VIEW: { - struct roots_xwayland_surface *xwayland_surface = - roots_xwayland_surface_from_view(view); - if (xwayland_surface->xwayland_surface->surface == wlr_surface) - found_view = view; - break; - } -#endif + if (view->wlr_surface == wlr_surface) { + return view; } } - return found_view; + return NULL; }
and it appears to work.
mentioned in issue calls#106
mentioned in issue #82