mirror of
https://github.com/labwc/labwc.git
synced 2026-02-15 22:05:25 -05:00
view: Add view_move_to_front/back().
This avoids calling view->impl functions from cursor.c and desktop.c. v2: Add an explicit recursion guard in cursor_update_focus().
This commit is contained in:
parent
12f3314595
commit
d7dd366bad
11 changed files with 52 additions and 43 deletions
|
|
@ -12,30 +12,6 @@
|
|||
#include "workspaces.h"
|
||||
#include "xwayland.h"
|
||||
|
||||
void
|
||||
desktop_move_to_front(struct view *view)
|
||||
{
|
||||
if (!view) {
|
||||
return;
|
||||
}
|
||||
if (view->impl->move_to_front) {
|
||||
view->impl->move_to_front(view);
|
||||
cursor_update_focus(view->server);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
desktop_move_to_back(struct view *view)
|
||||
{
|
||||
if (!view) {
|
||||
return;
|
||||
}
|
||||
if (view->impl->move_to_back) {
|
||||
view->impl->move_to_back(view);
|
||||
cursor_update_focus(view->server);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
desktop_arrange_all_views(struct server *server)
|
||||
{
|
||||
|
|
@ -267,7 +243,9 @@ desktop_focus_topmost_mapped_view(struct server *server)
|
|||
{
|
||||
struct view *view = topmost_mapped_view(server);
|
||||
desktop_focus_and_activate_view(&server->seat, view);
|
||||
desktop_move_to_front(view);
|
||||
if (view) {
|
||||
view_move_to_front(view);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue