Changeset 3a6d44b7 in mainline for uspace/app/taskbar/wndlist.c


Ignore:
Timestamp:
2022-11-07T17:42:51Z (16 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
60ebe63
Parents:
f1f433d
Message:

Activate window by pushing window button on taskbar

Note that with multiple seats, one would need to know which seat pushed
the button and set the appropriate focus.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/taskbar/wndlist.c

    rf1f433d r3a6d44b7  
    5050static void wndlist_wm_window_changed(void *, sysarg_t);
    5151
     52/** Window list WM callbacks */
    5253static wndmgt_cb_t wndlist_wndmgt_cb = {
    5354        .window_added = wndlist_wm_window_added,
    5455        .window_removed = wndlist_wm_window_removed,
    5556        .window_changed = wndlist_wm_window_changed
     57};
     58
     59static void wndlist_button_clicked(ui_pbutton_t *, void *);
     60
     61/** Window list button callbacks */
     62static ui_pbutton_cb_t wndlist_button_cb = {
     63        .clicked = wndlist_button_clicked
    5664};
    5765
     
    186194        /* Set the button rectangle */
    187195        wndlist_set_entry_rect(wndlist, entry);
     196
     197        /* Set button callbacks */
     198        ui_pbutton_set_cb(entry->button, &wndlist_button_cb, (void *)entry);
    188199
    189200        rc = ui_fixed_add(wndlist->fixed, ui_pbutton_ctl(entry->button));
     
    340351        wndlist_entry_t *entry;
    341352
    342         printf("wm_window_removed: wndlist=%p wnd_id=%zu\n",
    343             (void *)wndlist, wnd_id);
    344 
    345353        entry = wndlist_entry_by_id(wndlist, wnd_id);
    346354        if (entry == NULL)
     
    361369        wndlist_entry_t *entry;
    362370        errno_t rc;
    363 
    364         printf("wm_window_changed: wndlist=%p wnd_id=%zu\n",
    365             (void *)wndlist, wnd_id);
    366371
    367372        entry = wndlist_entry_by_id(wndlist, wnd_id);
     
    440445}
    441446
     447/** Window button was clicked.
     448 *
     449 * @param pbutton Push button
     450 * @param arg Argument (wdnlist_entry_t *)
     451 */
     452static void wndlist_button_clicked(ui_pbutton_t *pbutton, void *arg)
     453{
     454        wndlist_entry_t *entry = (wndlist_entry_t *)arg;
     455        sysarg_t seat_id;
     456
     457        seat_id = 0; // TODO Multi-seat
     458
     459        (void) wndmgt_activate_window(entry->wndlist->wndmgt,
     460            seat_id, entry->wnd_id);
     461}
     462
    442463/** @}
    443464 */
Note: See TracChangeset for help on using the changeset viewer.