Changeset a6492460 in mainline for uspace/app/taskbar/taskbar.c


Ignore:
Timestamp:
2022-11-09T16:17:59Z (18 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
88d828e
Parents:
54593f3
Message:

Pass ID of device that clicked the window button to activate window

To ensure the correct seat's focus is switched.

File:
1 edited

Legend:

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

    r54593f3 ra6492460  
    3434
    3535#include <gfx/coord.h>
     36#include <io/pos_event.h>
    3637#include <stdio.h>
    3738#include <stdlib.h>
     
    4748#include "wndlist.h"
    4849
    49 static void wnd_close(ui_window_t *, void *);
     50static void taskbar_wnd_close(ui_window_t *, void *);
     51static void taskbar_wnd_pos(ui_window_t *, void *, pos_event_t *);
    5052
    5153static ui_window_cb_t window_cb = {
    52         .close = wnd_close
     54        .close = taskbar_wnd_close,
     55        .pos = taskbar_wnd_pos
    5356};
    5457
     
    5861 * @param arg Argument (taskbar)
    5962 */
    60 static void wnd_close(ui_window_t *window, void *arg)
     63static void taskbar_wnd_close(ui_window_t *window, void *arg)
    6164{
    6265        taskbar_t *taskbar = (taskbar_t *) arg;
    6366
    6467        ui_quit(taskbar->ui);
     68}
     69
     70/** Window received position event.
     71 *
     72 * @param window Window
     73 * @param arg Argument (taskbar)
     74 * @param event Position event
     75 */
     76static void taskbar_wnd_pos(ui_window_t *window, void *arg, pos_event_t *event)
     77{
     78        taskbar_t *taskbar = (taskbar_t *) arg;
     79
     80        /* Remember ID of device that sent the last event */
     81        taskbar->wndlist->ev_pos_id = event->pos_id;
     82
     83        ui_window_def_pos(window, event);
    6584}
    6685
     
    130149        }
    131150
    132         ui_window_set_cb(taskbar->window, &window_cb, (void *) &taskbar);
     151        ui_window_set_cb(taskbar->window, &window_cb, (void *)taskbar);
    133152        ui_res = ui_window_get_res(taskbar->window);
    134153
Note: See TracChangeset for help on using the changeset viewer.