mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
Prepare OSD for reimplementation of the preview feature
This commit is contained in:
parent
a32e1ff8f9
commit
296e58079f
5 changed files with 28 additions and 21 deletions
13
src/view.c
13
src/view.c
|
|
@ -808,25 +808,26 @@ view_destroy(struct view *view)
|
|||
server->focused_view = NULL;
|
||||
}
|
||||
|
||||
if (server->cycle_view == view) {
|
||||
struct osd_state *osd_state = &view->server->osd_state;
|
||||
if (osd_state->cycle_view == view) {
|
||||
/*
|
||||
* If we are the current OSD selected view, cycle
|
||||
* to the next because we are dying.
|
||||
*/
|
||||
server->cycle_view = desktop_cycle_view(server,
|
||||
server->cycle_view, LAB_CYCLE_DIR_BACKWARD);
|
||||
osd_state->cycle_view = desktop_cycle_view(server,
|
||||
osd_state->cycle_view, LAB_CYCLE_DIR_BACKWARD);
|
||||
|
||||
/*
|
||||
* If we cycled back to ourselves, then we have no windows.
|
||||
* just remove it and close the OSD for good.
|
||||
*/
|
||||
if (server->cycle_view == view || !server->cycle_view) {
|
||||
server->cycle_view = NULL;
|
||||
if (osd_state->cycle_view == view || !osd_state->cycle_view) {
|
||||
/* osd_finish() additionally resets cycle_view to NULL */
|
||||
osd_finish(server);
|
||||
}
|
||||
}
|
||||
|
||||
if (server->cycle_view) {
|
||||
if (osd_state->cycle_view) {
|
||||
/* Update the OSD to reflect the view has now gone. */
|
||||
osd_update(server);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue