Changeset b0a94854 in mainline for uspace/lib/gui/window.c
- Timestamp:
- 2020-02-19T13:28:34Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0a052b0
- Parents:
- e1f2079
- git-author:
- Jiri Svoboda <jiri@…> (2020-01-18 18:28:21)
- git-committer:
- Jiri Svoboda <jiri@…> (2020-02-19 13:28:34)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/gui/window.c
re1f2079 rb0a94854 83 83 static pixel_t color_caption_unfocus = PIXEL(255, 207, 207, 207); 84 84 85 static void window_focus_event(void *); 85 86 static void window_kbd_event(void *, kbd_event_t *); 86 87 static void window_pos_event(void *, pos_event_t *); 88 static void window_unfocus_event(void *); 87 89 88 90 static display_wnd_cb_t window_cb = { 91 .focus_event = window_focus_event, 89 92 .kbd_event = window_kbd_event, 90 .pos_event = window_pos_event 93 .pos_event = window_pos_event, 94 .unfocus_event = window_unfocus_event 91 95 }; 92 96 … … 587 591 break; 588 592 case ET_POSITION_EVENT: 589 if (!win->is_focused) {590 win->is_focused = true;591 handle_refresh(win);592 }593 593 deliver_position_event(win, event->data.pos); 594 594 break; … … 766 766 } 767 767 768 static void window_focus_event(void *arg) 769 { 770 window_t *win = (window_t *) arg; 771 window_event_t *event; 772 773 event = (window_event_t *) calloc(1, sizeof(window_event_t)); 774 if (event == NULL) 775 return; 776 777 link_initialize(&event->link); 778 event->type = ET_WINDOW_FOCUS; 779 prodcons_produce(&win->events, &event->link); 780 } 781 768 782 static void window_kbd_event(void *arg, kbd_event_t *kevent) 769 783 { … … 796 810 } 797 811 812 static void window_unfocus_event(void *arg) 813 { 814 window_t *win = (window_t *) arg; 815 window_event_t *event; 816 817 event = (window_event_t *) calloc(1, sizeof(window_event_t)); 818 if (event == NULL) 819 return; 820 821 link_initialize(&event->link); 822 event->type = ET_WINDOW_UNFOCUS; 823 prodcons_produce(&win->events, &event->link); 824 } 825 798 826 /** @} 799 827 */
Note:
See TracChangeset
for help on using the changeset viewer.