Changeset 338d0935 in mainline for uspace/lib/gui/window.c


Ignore:
Timestamp:
2020-03-02T11:22:01Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a2e104e
Parents:
7bb45e3
git-author:
Jiri Svoboda <jiri@…> (2020-02-01 11:18:50)
git-committer:
Jiri Svoboda <jiri@…> (2020-03-02 11:22:01)
Message:

Closing windows

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/gui/window.c

    r7bb45e3 r338d0935  
    8383static pixel_t color_caption_unfocus = PIXEL(255, 207, 207, 207);
    8484
     85static void window_close_event(void *);
    8586static void window_focus_event(void *);
    8687static void window_kbd_event(void *, kbd_event_t *);
     
    8990
    9091static display_wnd_cb_t window_cb = {
     92        .close_event = window_close_event,
    9193        .focus_event = window_focus_event,
    9294        .kbd_event = window_kbd_event,
     
    332334                        //win_grab(widget->window->osess, event.pos_id, flags);
    333335                } else if (close && btn_left) {
    334                         //win_close_request(widget->window->osess);
     336                        window_close(widget->window);
    335337                } else if (header && btn_left) {
    336338                        window_grab_flags_t flags = GF_EMPTY;
     
    766768void window_close(window_t *win)
    767769{
    768         /* Request compositor to init closing cascade. */
    769         //win_close_request(win->osess);
     770        window_event_t *event;
     771
     772        event = (window_event_t *) calloc(1, sizeof(window_event_t));
     773        if (event == NULL)
     774                return;
     775
     776        link_initialize(&event->link);
     777        event->type = ET_WINDOW_CLOSE;
     778        prodcons_produce(&win->events, &event->link);
     779}
     780
     781static void window_close_event(void *arg)
     782{
     783        window_t *win = (window_t *) arg;
     784
     785        window_close(win);
    770786}
    771787
Note: See TracChangeset for help on using the changeset viewer.