Changeset 5d62130 in mainline for uspace/srv/hid/display/display.c


Ignore:
Timestamp:
2022-11-13T10:56:43Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a130983
Parents:
a5c7b865
Message:

Taskbar should be always on top

We add support for topmost windows and make the taskbar window topmost.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/display/display.c

    ra5c7b865 r5d62130  
    313313}
    314314
     315/** Add window to window list.
     316 *
     317 * Topmost windows are enlisted before any other window. Non-topmost
     318 * windows are enlisted before any other non-topmost window.
     319 *
     320 * @param display Display
     321 * @param wnd Window
     322 */
     323void ds_display_enlist_window(ds_display_t *display, ds_window_t *wnd)
     324{
     325        ds_window_t *w;
     326
     327        assert(wnd->display == display);
     328        assert(!link_used(&wnd->ldwindows));
     329
     330        if ((wnd->flags & wndf_topmost) == 0) {
     331                /* Find the first non-topmost window */
     332                w = ds_display_first_window(display);
     333                while (w != NULL && (w->flags & wndf_topmost) != 0)
     334                        w = ds_display_next_window(w);
     335
     336                if (w != NULL)
     337                        list_insert_before(&wnd->ldwindows, &w->ldwindows);
     338                else
     339                        list_append(&wnd->ldwindows, &display->windows);
     340        } else {
     341                /* Insert at the beginning */
     342                list_prepend(&wnd->ldwindows, &display->windows);
     343        }
     344
     345}
     346
    315347/** Add window to display.
    316348 *
     
    326358
    327359        wnd->display = display;
    328         list_prepend(&wnd->ldwindows, &display->windows);
     360        ds_display_enlist_window(display, wnd);
    329361
    330362        /* Notify window managers about the new window */
     
    369401
    370402        list_remove(&wnd->ldwindows);
    371         list_prepend(&wnd->ldwindows, &wnd->display->windows);
     403        ds_display_enlist_window(wnd->display, wnd);
    372404}
    373405
Note: See TracChangeset for help on using the changeset viewer.