Changeset 4055fe63 in mainline
- Timestamp:
- 2021-06-04T20:02:36Z (3 years ago)
- Children:
- 4b72e81
- Parents:
- 2e6394e
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/menu.c
r2e6394e r4055fe63 61 61 }; 62 62 63 static void ui_menu_popup_close(ui_popup_t *, void *); 63 64 static void ui_menu_popup_pos(ui_popup_t *, void *, pos_event_t *); 64 65 65 66 static ui_popup_cb_t ui_menu_popup_cb = { 67 .close = ui_menu_popup_close, 66 68 .pos = ui_menu_popup_pos 67 69 }; … … 366 368 } else { 367 369 /* Press outside menu - close it */ 368 //if (event->type == POS_PRESS)369 //ui_menu_bar_select(menu->mbar, NULL, NULL);370 if (event->type == POS_PRESS) 371 ui_menu_bar_select(menu->mbar, NULL, NULL); 370 372 } 371 373 372 374 return ui_unclaimed; 375 } 376 377 /** Handle close event in menu popup window. 378 * 379 * @param popup Menu popup window 380 * @param arg Argument (ui_menu_t *) 381 */ 382 static void ui_menu_popup_close(ui_popup_t *popup, void *arg) 383 { 384 ui_menu_t *menu = (ui_menu_t *)arg; 385 386 /* Close the menu */ 387 ui_menu_bar_select(menu->mbar, NULL, NULL); 373 388 } 374 389 -
uspace/lib/ui/src/menubar.c
r2e6394e r4055fe63 61 61 static errno_t ui_menu_bar_ctl_paint(void *); 62 62 static ui_evclaim_t ui_menu_bar_ctl_pos_event(void *, pos_event_t *); 63 static void ui_menu_bar_ctl_unfocus(void *);64 63 65 64 /** Menu bar control ops */ … … 68 67 .paint = ui_menu_bar_ctl_paint, 69 68 .pos_event = ui_menu_bar_ctl_pos_event, 70 .unfocus = ui_menu_bar_ctl_unfocus71 69 }; 72 70 … … 317 315 } 318 316 319 /** Handle menu bar window unfocus notification.320 *321 * @param mbar Menu bar322 */323 void ui_menu_bar_unfocus(ui_menu_bar_t *mbar)324 {325 // ui_menu_bar_select(mbar, NULL, NULL);326 }327 328 317 /** Destroy menu bar control. 329 318 * … … 362 351 } 363 352 364 /** Handle menu bar control window unfocus notification.365 *366 * @param arg Argument (ui_menu_bar_t *)367 */368 void ui_menu_bar_ctl_unfocus(void *arg)369 {370 ui_menu_bar_t *mbar = (ui_menu_bar_t *) arg;371 372 ui_menu_bar_unfocus(mbar);373 }374 375 353 /** @} 376 354 */ -
uspace/lib/ui/src/popup.c
r2e6394e r4055fe63 46 46 #include "../private/popup.h" 47 47 48 static void ui_popup_window_close(ui_window_t *, void *); 48 49 static void ui_popup_window_pos(ui_window_t *, void *, pos_event_t *); 49 50 50 51 static ui_window_cb_t ui_popup_window_cb = { 52 .close = ui_popup_window_close, 51 53 .pos = ui_popup_window_pos 52 54 }; … … 185 187 } 186 188 189 /** Handle close event in popup window. 190 * 191 * @param window Window 192 * @param arg Argument (ui_popup_t *) 193 */ 194 static void ui_popup_window_close(ui_window_t *window, void *arg) 195 { 196 ui_popup_t *popup = (ui_popup_t *)arg; 197 198 if (popup->cb != NULL && popup->cb->close != NULL) 199 popup->cb->close(popup, popup->arg); 200 } 201 187 202 /** Handle position event in popup window. 188 203 * -
uspace/srv/hid/display/seat.c
r2e6394e r4055fe63 104 104 ds_window_bring_to_top(wnd); 105 105 } 106 107 /* When focus changes, popup window should be closed */ 108 ds_seat_set_popup(seat, NULL); 106 109 } 107 110 … … 113 116 void ds_seat_set_popup(ds_seat_t *seat, ds_window_t *wnd) 114 117 { 118 if (wnd == seat->popup) 119 return; 120 121 if (seat->popup != NULL) { 122 /* Window is no longer the popup window, send close request */ 123 ds_client_post_close_event(seat->popup->client, 124 seat->popup); 125 } 126 115 127 seat->popup = wnd; 116 128 } … … 139 151 140 152 if (seat->popup == wnd) 141 seat->popup = NULL;153 ds_seat_set_popup(seat, NULL); 142 154 } 143 155 … … 427 439 428 440 wnd = ds_display_window_by_pos(seat->display, &seat->pntpos); 429 /* 430 * Deliver event to popup window, unless the pointer is over 431 * it (in which case it will be delivered to that window 432 * below, anyway. 433 */ 441 442 /* Click outside popup window */ 443 if (event->type == POS_PRESS && wnd != seat->popup) { 444 /* Close popup window */ 445 ds_seat_set_popup(seat, NULL); 446 } 447 448 /* Deliver event to popup window. */ 434 449 if (seat->popup != NULL) { 435 450 rc = ds_window_post_pos_event(seat->popup, event);
Note:
See TracChangeset
for help on using the changeset viewer.