Advertisement
Guest User

Untitled

a guest
May 25th, 2022
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.06 KB | None | 0 0
  1. diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
  2. index ef63edcb..15c2fe42 100644
  3. --- a/desktop-shell/shell.c
  4. +++ b/desktop-shell/shell.c
  5. @@ -1929,6 +1929,15 @@ shell_surface_update_child_surface_layers (struct shell_surface *shsurf)
  6.     weston_desktop_surface_propagate_layer(shsurf->desktop_surface);
  7.  }
  8.  
  9. +static void
  10. +wl_list_prepend(struct wl_list *list, struct wl_list *elm)
  11. +{
  12. +   elm->prev = list->prev;
  13. +   elm->next = list;
  14. +   list->prev = elm;
  15. +   elm->prev->next = elm;
  16. +}
  17. +
  18.  /* Update the surface’s layer. Mark both the old and new views as having dirty
  19.   * geometry to ensure the changes are redrawn.
  20.   *
  21. @@ -1940,6 +1949,7 @@ shell_surface_update_layer(struct shell_surface *shsurf)
  22.     struct weston_surface *surface =
  23.         weston_desktop_surface_get_surface(shsurf->desktop_surface);
  24.     struct weston_layer_entry *new_layer_link;
  25. +   const char *app_id;
  26.  
  27.     new_layer_link = shell_surface_calculate_layer_link(shsurf);
  28.  
  29. @@ -1948,9 +1958,30 @@ shell_surface_update_layer(struct shell_surface *shsurf)
  30.     if (new_layer_link == &shsurf->view->layer_link)
  31.         return;
  32.  
  33. +   app_id = weston_desktop_surface_get_app_id(shsurf->desktop_surface);
  34. +
  35.     weston_view_geometry_dirty(shsurf->view);
  36.     weston_layer_entry_remove(&shsurf->view->layer_link);
  37. -   weston_layer_entry_insert(new_layer_link, &shsurf->view->layer_link);
  38. +
  39. +   /* Prepend video output surface to keep it below other surfaces. */
  40. +   if ((app_id != NULL) && !strcmp("video-output", app_id)) {
  41. +       struct weston_layer_entry *list = new_layer_link;
  42. +       struct weston_layer_entry *entry = &shsurf->view->layer_link;
  43. +
  44. +       const char *t = weston_desktop_surface_get_title(shsurf->desktop_surface);
  45. +
  46. +       weston_log(
  47. +           "prepending instead of appending surface for "
  48. +           "application with title \"%s\"\n",
  49. +           (t == NULL) ? "<no title>" : t
  50. +       );
  51. +
  52. +       wl_list_prepend(&list->link, &entry->link);
  53. +
  54. +       entry->layer = list->layer;
  55. +   } else
  56. +       weston_layer_entry_insert(new_layer_link, &shsurf->view->layer_link);
  57. +
  58.     weston_view_geometry_dirty(shsurf->view);
  59.     weston_surface_damage(surface);
  60.  
  61.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement