mirror of
https://github.com/labwc/labwc.git
synced 2026-02-05 04:06:33 -05:00
Our current approach to handling the focused/active view is a bit confusing. In particular, it's hard to be sure when server->focused_view is or isn't in sync with the real wlroots keyboard focus. Try to clean things up a bit. In particular: - Add comments to server->focused_view and desktop_focused_view() to clarify that they should match, but it's not guaranteed. - desktop_focused_view() now prints a warning if it detects that server->focused_view is out of sync. We should keep an eye out for this warning, and if we see it, try to figure out why it happened. - For consistency, use only "focus/defocus" as the verbs in function names rather than "activate". This is a bit arbitrary, but the idea is that focus is the primary action while the active/inactive state is a side effect. - view_focus/defocus() replace view_set_activated() and now update both focus and active/inactive state, to try to keep them in sync. - Add comments at view_focus/defocus() to warn against calling them directly (we should generally call the desktop.c functions). - desktop_focus_view(NULL) is now forbidden and is no longer handled as a special case to clear the focus. This was (at least to me) a surprising behavior and caused trouble when working on another change. - To maintain existing behavior, desktop_focus_topmost_mapped_view() now explicitly clears the focus if there are no mapped views. There should be no behavioral change here. |
||
|---|---|---|
| .. | ||
| button | ||
| common | ||
| config | ||
| menu | ||
| action.h | ||
| buffer.h | ||
| cursor.h | ||
| debug.h | ||
| decorations.h | ||
| dnd.h | ||
| idle.h | ||
| key-state.h | ||
| labwc.h | ||
| layers.h | ||
| meson.build | ||
| node.h | ||
| regions.h | ||
| resistance.h | ||
| resize_indicator.h | ||
| session-lock.h | ||
| ssd-internal.h | ||
| ssd.h | ||
| theme.h | ||
| view-impl-common.h | ||
| view.h | ||
| window-rules.h | ||
| workspaces.h | ||
| xwayland.h | ||