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


Ignore:
Timestamp:
2023-01-20T11:50:41Z (23 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b1f0a14
Parents:
6828a56
git-author:
Jiri Svoboda <jiri@…> (2023-01-20 19:50:21)
git-committer:
Jiri Svoboda <jiri@…> (2023-01-20 11:50:41)
Message:

Create menu windows in the correct seat

Add a mechanism to set the seat of a new display window, UI window,
UI popup - input device ID. This is set to the ID of the device which
activated the menu (mouse, keyboard). The display server determines
the correct seat from there.

This makes sure clicking outside closes the correct pop-up window.

File:
1 edited

Legend:

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

    r6828a56 r5d380b6  
    8888        }
    8989
     90        /* Caption */
    9091        wnd->caption = str_dup(params->caption);
    9192        if (wnd->caption == NULL) {
     
    99100        gfx_bitmap_params_init(&bparams);
    100101        bparams.rect = params->rect;
     102
     103        /* Allocate window bitmap */
    101104
    102105        dgc = ds_display_get_gc(wnd->display);
     
    142145        }
    143146
    144         // TODO Multi-seat: which seat should own the new window?
    145         seat = ds_display_first_seat(client->display);
    146 
     147        /* Determine which seat should own the window */
     148        if (params->idev_id != 0)
     149                seat = ds_display_seat_by_idev(wnd->display, params->idev_id);
     150        else
     151                seat = ds_display_default_seat(wnd->display);
     152
     153        /* Is this a popup window? */
    147154        if ((params->flags & wndf_popup) != 0)
    148155                ds_seat_set_popup(seat, wnd);
     
    150157                ds_seat_set_focus(seat, wnd);
    151158
     159        /* Is this window a panel? */
    152160        if ((params->flags & wndf_avoid) != 0)
    153161                ds_display_update_max_rect(wnd->display);
Note: See TracChangeset for help on using the changeset viewer.