Changes in uspace/srv/hid/display/window.c [0d00e53:90f1f19] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/window.c
r0d00e53 r90f1f19 1 1 /* 2 * Copyright (c) 202 4Jiri Svoboda2 * Copyright (c) 2021 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 44 44 #include <memgfx/memgc.h> 45 45 #include <stdlib.h> 46 #include <str.h>47 #include <wndmgt.h>48 46 #include "client.h" 49 47 #include "display.h" 50 48 #include "seat.h" 51 49 #include "window.h" 52 #include "wmclient.h"53 50 54 51 static void ds_window_invalidate_cb(void *, gfx_rect_t *); … … 56 53 static void ds_window_get_preview_rect(ds_window_t *, gfx_rect_t *); 57 54 58 static mem_gc_cb_t ds_window_mem_gc_cb = {59 .invalidate = ds_window_invalidate_cb,60 .update = ds_window_update_cb61 };62 63 55 /** Create window. 64 56 * … … 67 59 * @param client Client owning the window 68 60 * @param params Window parameters 69 * @param r wnd Place to store pointer to new window.61 * @param rgc Place to store pointer to new GC. 70 62 * 71 63 * @return EOK on success or an error code 72 64 */ 73 65 errno_t ds_window_create(ds_client_t *client, display_wnd_params_t *params, 74 ds_window_t **r wnd)66 ds_window_t **rgc) 75 67 { 76 68 ds_window_t *wnd = NULL; … … 88 80 } 89 81 90 /* Caption */91 wnd->caption = str_dup(params->caption);92 if (wnd->caption == NULL) {93 rc = ENOMEM;94 goto error;95 }96 97 wnd->flags = params->flags;98 99 82 ds_client_add_window(client, wnd); 100 83 ds_display_add_window(client->display, wnd); … … 102 85 gfx_bitmap_params_init(&bparams); 103 86 bparams.rect = params->rect; 104 105 /* Allocate window bitmap */106 87 107 88 dgc = ds_display_get_gc(wnd->display); … … 127 108 } 128 109 129 rc = mem_gc_create(¶ms->rect, &alloc, &ds_window_mem_gc_cb,130 (void *)wnd, &wnd->mgc);110 rc = mem_gc_create(¶ms->rect, &alloc, ds_window_invalidate_cb, 111 ds_window_update_cb, (void *)wnd, &wnd->mgc); 131 112 if (rc != EOK) 132 113 goto error; … … 136 117 wnd->gc = mem_gc_get_ctx(wnd->mgc); 137 118 wnd->cursor = wnd->display->cursor[dcurs_arrow]; 119 wnd->flags = params->flags; 138 120 139 121 if ((params->flags & wndf_setpos) != 0) { … … 146 128 } 147 129 148 /* Determine which seat should own the window */ 149 if (params->idev_id != 0) 150 seat = ds_display_seat_by_idev(wnd->display, params->idev_id); 130 seat = ds_display_first_seat(client->display); 131 132 if ((params->flags & wndf_popup) != 0) 133 ds_seat_set_popup(seat, wnd); 151 134 else 152 seat = ds_display_default_seat(wnd->display); 153 154 /* Is this a popup window? */ 155 if ((params->flags & wndf_popup) != 0) { 156 ds_seat_set_popup(seat, wnd); 157 } else { 158 if ((params->flags & wndf_nofocus) == 0) 159 ds_seat_set_focus(seat, wnd); 160 } 161 162 /* Is this window a panel? */ 163 if ((params->flags & wndf_avoid) != 0) 164 ds_display_update_max_rect(wnd->display); 135 ds_seat_set_focus(seat, wnd); 165 136 166 137 (void) ds_display_paint(wnd->display, NULL); 167 138 168 *r wnd= wnd;139 *rgc = wnd; 169 140 return EOK; 170 141 error: 171 142 if (wnd != NULL) { 172 ds_client_remove_window(wnd);173 ds_display_remove_window(wnd);174 if (wnd->mgc != NULL)175 mem_gc_delete(wnd->mgc);176 143 if (wnd->bitmap != NULL) 177 144 gfx_bitmap_destroy(wnd->bitmap); 178 if (wnd->caption != NULL)179 free(wnd->caption);180 145 free(wnd); 181 146 } … … 193 158 194 159 disp = wnd->display; 195 196 ds_window_unfocus(wnd);197 160 198 161 ds_client_remove_window(wnd); 199 162 ds_display_remove_window(wnd); 200 163 201 if ((wnd->flags & wndf_avoid) != 0)202 ds_display_update_max_rect(disp);203 204 164 mem_gc_delete(wnd->mgc); 205 165 … … 207 167 gfx_bitmap_destroy(wnd->bitmap); 208 168 209 free(wnd->caption);210 169 free(wnd); 211 170 … … 219 178 void ds_window_bring_to_top(ds_window_t *wnd) 220 179 { 221 ds_display_window_to_top(wnd); 180 ds_display_t *disp = wnd->display; 181 182 ds_display_remove_window(wnd); 183 ds_display_add_window(disp, wnd); 222 184 (void) ds_display_paint(wnd->display, NULL); 223 185 } … … 231 193 { 232 194 return wnd->gc; 233 }234 235 /** Determine if window is visible.236 *237 * @param wnd Window238 * @return @c true iff window is visible239 */240 bool ds_window_is_visible(ds_window_t *wnd)241 {242 return (wnd->flags & wndf_minimized) == 0;243 195 } 244 196 … … 255 207 gfx_rect_t crect; 256 208 257 log_msg(LOG_DEFAULT, LVL_DEBUG2, "ds_window_paint"); 258 259 /* Skip painting the window if not visible */ 260 if (!ds_window_is_visible(wnd)) 261 return EOK; 209 log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_paint"); 262 210 263 211 if (rect != NULL) { … … 404 352 bool newr; 405 353 406 log_msg(LOG_DEFAULT, LVL_DEBUG 2, "ds_window_repaint_preview");354 log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_repaint_preview"); 407 355 408 356 /* … … 448 396 * @param wnd Window 449 397 * @param pos Position where mouse button was pressed 450 * @param pos_id Positioning device ID 451 */ 452 static void ds_window_start_move(ds_window_t *wnd, gfx_coord2_t *pos, 453 sysarg_t pos_id) 398 */ 399 static void ds_window_start_move(ds_window_t *wnd, gfx_coord2_t *pos) 454 400 { 455 401 log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_start_move (%d, %d)", … … 460 406 461 407 wnd->orig_pos = *pos; 462 wnd->orig_pos_id = pos_id;463 408 wnd->state = dsw_moving; 464 409 wnd->preview_pos = wnd->dpos; … … 490 435 wnd->dpos = nwpos; 491 436 wnd->state = dsw_idle; 492 wnd->orig_pos_id = 0;493 437 494 438 (void) ds_display_paint(wnd->display, NULL); … … 506 450 gfx_rect_t old_rect; 507 451 508 log_msg(LOG_DEFAULT, LVL_DEBUG 2, "ds_window_update_move (%d, %d)",452 log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_update_move (%d, %d)", 509 453 (int) pos->x, (int) pos->y); 510 454 … … 525 469 * @param rsztype Resize type (which part of window is being dragged) 526 470 * @param pos Position where mouse button was pressed 527 * @param pos_id Positioning device ID528 471 */ 529 472 static void ds_window_start_resize(ds_window_t *wnd, 530 display_wnd_rsztype_t rsztype, gfx_coord2_t *pos , sysarg_t pos_id)473 display_wnd_rsztype_t rsztype, gfx_coord2_t *pos) 531 474 { 532 475 ds_seat_t *seat; … … 539 482 return; 540 483 541 /* Determine which seat started the resize */542 seat = ds_display_seat_by_idev(wnd->display, pos_id);543 if (seat == NULL)544 return;545 546 484 wnd->orig_pos = *pos; 547 wnd->orig_pos_id = pos_id;548 485 wnd->state = dsw_resizing; 549 486 wnd->rsztype = rsztype; 550 487 wnd->preview_rect = wnd->rect; 551 488 489 // XXX Need client to tell us which seat started the resize! 490 seat = ds_display_first_seat(wnd->display); 552 491 ctype = display_cursor_from_wrsz(rsztype); 553 492 ds_seat_set_wm_cursor(seat, wnd->display->cursor[ctype]); … … 579 518 ds_client_post_resize_event(wnd->client, wnd, &nrect); 580 519 581 /* Determine which seat started the resize */ 582 seat = ds_display_seat_by_idev(wnd->display, wnd->orig_pos_id); 583 if (seat != NULL) 584 ds_seat_set_wm_cursor(seat, NULL); 585 586 wnd->orig_pos_id = 0; 520 // XXX Need to know which seat started the resize! 521 seat = ds_display_first_seat(wnd->display); 522 ds_seat_set_wm_cursor(seat, NULL); 587 523 588 524 (void) ds_display_paint(wnd->display, NULL); … … 600 536 gfx_rect_t old_rect; 601 537 602 log_msg(LOG_DEFAULT, LVL_DEBUG 2, "ds_window_update_resize (%d, %d)",538 log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_update_resize (%d, %d)", 603 539 (int) pos->x, (int) pos->y); 604 540 … … 639 575 * @param wnd Window 640 576 * @param event Position event 641 *642 * @return EOK on success or an error code643 577 */ 644 578 errno_t ds_window_post_pos_event(ds_window_t *wnd, pos_event_t *event) … … 646 580 pos_event_t tevent; 647 581 gfx_coord2_t pos; 648 sysarg_t pos_id;649 582 gfx_rect_t drect; 650 583 bool inside; 651 584 652 log_msg(LOG_DEFAULT, LVL_DEBUG 2,585 log_msg(LOG_DEFAULT, LVL_DEBUG, 653 586 "ds_window_post_pos_event type=%d pos=%d,%d", event->type, 654 587 (int) event->hpos, (int) event->vpos); … … 656 589 pos.x = event->hpos; 657 590 pos.y = event->vpos; 658 pos_id = event->pos_id;659 591 gfx_rect_translate(&wnd->dpos, &wnd->rect, &drect); 660 592 inside = gfx_pix_inside_rect(&pos, &drect); 661 593 662 if (event->type == POS_PRESS && event->btn_num == 2 && inside && 663 (wnd->flags & wndf_maximized) == 0) { 664 ds_window_start_move(wnd, &pos, pos_id); 594 if (event->type == POS_PRESS && event->btn_num == 2 && inside) { 595 ds_window_start_move(wnd, &pos); 665 596 return EOK; 666 597 } 667 598 668 599 if (event->type == POS_RELEASE) { 669 /* Finish move/resize if they were started by the same seat */ 670 if (wnd->state == dsw_moving && 671 ds_window_orig_seat(wnd, pos_id)) { 600 if (wnd->state == dsw_moving) { 672 601 ds_window_finish_move(wnd, &pos); 673 602 return EOK; 674 603 } 675 604 676 if (wnd->state == dsw_resizing && 677 ds_window_orig_seat(wnd, pos_id)) { 605 if (wnd->state == dsw_resizing) { 678 606 ds_window_finish_resize(wnd, &pos); 679 607 return EOK; … … 682 610 683 611 if (event->type == POS_UPDATE) { 684 /* Update move/resize if they were started by the same seat */ 685 if (wnd->state == dsw_moving && 686 ds_window_orig_seat(wnd, pos_id)) { 612 if (wnd->state == dsw_moving) { 687 613 ds_window_update_move(wnd, &pos); 688 614 return EOK; 689 615 } 690 616 691 if (wnd->state == dsw_resizing && 692 ds_window_orig_seat(wnd, pos_id)) { 617 if (wnd->state == dsw_resizing) { 693 618 ds_window_update_resize(wnd, &pos); 694 619 return EOK; … … 707 632 * 708 633 * @param wnd Window 709 * @return EOK on success or an error code710 634 */ 711 635 errno_t ds_window_post_focus_event(ds_window_t *wnd) 712 636 { 713 display_wnd_focus_ev_t efocus;714 errno_t rc;715 ds_wmclient_t *wmclient;716 717 637 log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_post_focus_event"); 718 638 719 /* Increase focus counter */ 720 ++wnd->nfocus; 721 efocus.nfocus = wnd->nfocus; 722 723 rc = ds_client_post_focus_event(wnd->client, wnd, &efocus); 724 if (rc != EOK) 725 return rc; 726 727 /* Notify window managers about window information change */ 728 wmclient = ds_display_first_wmclient(wnd->display); 729 while (wmclient != NULL) { 730 ds_wmclient_post_wnd_changed_event(wmclient, wnd->id); 731 wmclient = ds_display_next_wmclient(wmclient); 732 } 733 734 return EOK; 639 return ds_client_post_focus_event(wnd->client, wnd); 735 640 } 736 641 … … 738 643 * 739 644 * @param wnd Window 740 * @return EOK on success or an error code741 645 */ 742 646 errno_t ds_window_post_unfocus_event(ds_window_t *wnd) 743 647 { 744 display_wnd_unfocus_ev_t eunfocus;745 errno_t rc;746 ds_wmclient_t *wmclient;747 748 648 log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_post_unfocus_event"); 749 649 750 /* Decrease focus counter */ 751 --wnd->nfocus; 752 eunfocus.nfocus = wnd->nfocus; 753 754 rc = ds_client_post_unfocus_event(wnd->client, wnd, &eunfocus); 755 if (rc != EOK) 756 return rc; 757 758 /* Notify window managers about window information change */ 759 wmclient = ds_display_first_wmclient(wnd->display); 760 while (wmclient != NULL) { 761 ds_wmclient_post_wnd_changed_event(wmclient, wnd->id); 762 wmclient = ds_display_next_wmclient(wmclient); 763 } 764 765 return EOK; 650 return ds_client_post_unfocus_event(wnd->client, wnd); 766 651 } 767 652 … … 771 656 * @param pos Position where the pointer was when the move started 772 657 * relative to the window 773 * @param pos_id Positioning device ID774 658 * @param event Button press event 775 659 */ 776 void ds_window_move_req(ds_window_t *wnd, gfx_coord2_t *pos , sysarg_t pos_id)660 void ds_window_move_req(ds_window_t *wnd, gfx_coord2_t *pos) 777 661 { 778 662 gfx_coord2_t orig_pos; … … 782 666 783 667 gfx_coord2_add(&wnd->dpos, pos, &orig_pos); 784 ds_window_start_move(wnd, &orig_pos , pos_id);668 ds_window_start_move(wnd, &orig_pos); 785 669 } 786 670 … … 802 686 { 803 687 *dpos = wnd->dpos; 804 }805 806 /** Get maximized window rectangle.807 *808 * @param wnd Window809 */810 void ds_window_get_max_rect(ds_window_t *wnd, gfx_rect_t *rect)811 {812 *rect = wnd->display->max_rect;813 688 } 814 689 … … 819 694 * @param pos Position where the pointer was when the resize started 820 695 * relative to the window 821 * @param pos_id Positioning device ID822 696 * @param event Button press event 823 697 */ 824 698 void ds_window_resize_req(ds_window_t *wnd, display_wnd_rsztype_t rsztype, 825 gfx_coord2_t *pos , sysarg_t pos_id)699 gfx_coord2_t *pos) 826 700 { 827 701 gfx_coord2_t orig_pos; 828 702 829 log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_resize_req (%d, %d, %d , %d)",830 (int) rsztype, (int)pos->x, (int)pos->y, (int)pos_id);703 log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_resize_req (%d, %d, %d)", 704 (int) rsztype, (int) pos->x, (int) pos->y); 831 705 832 706 gfx_coord2_add(&wnd->dpos, pos, &orig_pos); 833 ds_window_start_resize(wnd, rsztype, &orig_pos , pos_id);707 ds_window_start_resize(wnd, rsztype, &orig_pos); 834 708 } 835 709 … … 837 711 * 838 712 * @param wnd Window 839 * @return EOK on success or an error code840 713 */ 841 714 errno_t ds_window_resize(ds_window_t *wnd, gfx_coord2_t *offs, … … 888 761 wnd->rect = *nrect; 889 762 890 if ((wnd->flags & wndf_avoid) != 0)891 ds_display_update_max_rect(wnd->display);892 893 763 (void) ds_display_paint(wnd->display, NULL); 894 return EOK;895 }896 897 /** Minimize window.898 *899 * @param wnd Window900 * @return EOK on success or an error code901 */902 errno_t ds_window_minimize(ds_window_t *wnd)903 {904 /* If already minimized, do nothing and return success. */905 if ((wnd->flags & wndf_minimized) != 0)906 return EOK;907 908 ds_window_unfocus(wnd);909 910 wnd->flags |= wndf_minimized;911 (void) ds_display_paint(wnd->display, NULL);912 return EOK;913 }914 915 /** Unminimize window.916 *917 * @param wnd Window918 * @return EOK on success or an error code919 */920 errno_t ds_window_unminimize(ds_window_t *wnd)921 {922 /* If not minimized, do nothing and return success. */923 if ((wnd->flags & wndf_minimized) == 0)924 return EOK;925 926 wnd->flags &= ~wndf_minimized;927 (void) ds_display_paint(wnd->display, NULL);928 return EOK;929 }930 931 /** Maximize window.932 *933 * @param wnd Window934 * @return EOK on success or an error code935 */936 errno_t ds_window_maximize(ds_window_t *wnd)937 {938 gfx_coord2_t old_dpos;939 gfx_rect_t old_rect;940 gfx_coord2_t offs;941 gfx_rect_t max_rect;942 gfx_rect_t nrect;943 errno_t rc;944 945 /* If already maximized, do nothing and return success. */946 if ((wnd->flags & wndf_maximized) != 0)947 return EOK;948 949 /* Remember the old window rectangle and display position */950 old_rect = wnd->rect;951 old_dpos = wnd->dpos;952 953 ds_window_get_max_rect(wnd, &max_rect);954 955 /* Keep window contents on the same position on the screen */956 offs.x = max_rect.p0.x - wnd->dpos.x;957 offs.y = max_rect.p0.y - wnd->dpos.y;958 959 /* Maximized window's coordinates will start at 0,0 */960 gfx_rect_rtranslate(&max_rect.p0, &max_rect, &nrect);961 962 rc = ds_window_resize(wnd, &offs, &nrect);963 if (rc != EOK)964 return rc;965 966 /* Set window flags, remember normal rectangle */967 wnd->flags |= wndf_maximized;968 wnd->normal_rect = old_rect;969 wnd->normal_dpos = old_dpos;970 971 return EOK;972 }973 974 /** Unmaximize window.975 *976 * @param wnd Window977 * @return EOK on success or an error code978 */979 errno_t ds_window_unmaximize(ds_window_t *wnd)980 {981 gfx_coord2_t offs;982 errno_t rc;983 984 /* If not maximized, do nothing and return success. */985 if ((wnd->flags & wndf_maximized) == 0)986 return EOK;987 988 /* Keep window contents on the same position on the screen */989 offs.x = wnd->normal_dpos.x - wnd->dpos.x;990 offs.y = wnd->normal_dpos.y - wnd->dpos.y;991 992 rc = ds_window_resize(wnd, &offs, &wnd->normal_rect);993 if (rc != EOK)994 return rc;995 996 /* Clear maximized flag */997 wnd->flags &= ~wndf_maximized;998 999 764 return EOK; 1000 765 } … … 1042 807 * 1043 808 * @param wnd Window 1044 * @param cursor New cursor1045 809 * @return EOK on success, EINVAL if @a cursor is invalid 1046 810 */ … … 1056 820 } 1057 821 1058 /** Set window caption.1059 *1060 * @param wnd Window1061 * @param caption New caption1062 *1063 * @return EOK on success, EINVAL if @a cursor is invalid1064 */1065 errno_t ds_window_set_caption(ds_window_t *wnd, const char *caption)1066 {1067 char *dcaption;1068 ds_wmclient_t *wmclient;1069 1070 dcaption = str_dup(caption);1071 if (dcaption == NULL)1072 return ENOMEM;1073 1074 free(wnd->caption);1075 wnd->caption = dcaption;1076 1077 /* Notify window managers about window information change */1078 wmclient = ds_display_first_wmclient(wnd->display);1079 while (wmclient != NULL) {1080 ds_wmclient_post_wnd_changed_event(wmclient, wnd->id);1081 wmclient = ds_display_next_wmclient(wmclient);1082 }1083 1084 return EOK;1085 }1086 1087 /** Find alternate window with the allowed flags.1088 *1089 * An alternate window is a *different* window that is preferably previous1090 * in the display order and only has the @a allowed flags.1091 *1092 * @param wnd Window1093 * @param allowed_flags Bitmask of flags that the window is allowed to have1094 *1095 * @return Alternate window matching the criteria or @c NULL if there is none1096 */1097 ds_window_t *ds_window_find_prev(ds_window_t *wnd,1098 display_wnd_flags_t allowed_flags)1099 {1100 ds_window_t *nwnd;1101 1102 /* Try preceding windows in display order */1103 nwnd = ds_display_next_window(wnd);1104 while (nwnd != NULL && (nwnd->flags & ~allowed_flags) != 0) {1105 nwnd = ds_display_next_window(nwnd);1106 }1107 1108 /* Do we already have a matching window? */1109 if (nwnd != NULL && (nwnd->flags & ~allowed_flags) == 0) {1110 return nwnd;1111 }1112 1113 /* Try succeeding windows in display order */1114 nwnd = ds_display_first_window(wnd->display);1115 while (nwnd != NULL && nwnd != wnd &&1116 (nwnd->flags & ~allowed_flags) != 0) {1117 nwnd = ds_display_next_window(nwnd);1118 }1119 1120 if (nwnd == wnd)1121 return NULL;1122 1123 return nwnd;1124 }1125 1126 /** Find alternate window with the allowed flags.1127 *1128 * An alternate window is a *different* window that is preferably previous1129 * in the display order and only has the @a allowed flags.1130 *1131 * @param wnd Window1132 * @param allowed_flags Bitmask of flags that the window is allowed to have1133 *1134 * @return Alternate window matching the criteria or @c NULL if there is none1135 */1136 ds_window_t *ds_window_find_next(ds_window_t *wnd,1137 display_wnd_flags_t allowed_flags)1138 {1139 ds_window_t *nwnd;1140 1141 /* Try preceding windows in display order */1142 nwnd = ds_display_prev_window(wnd);1143 while (nwnd != NULL && (nwnd->flags & ~allowed_flags) != 0) {1144 nwnd = ds_display_prev_window(nwnd);1145 }1146 1147 /* Do we already have a matching window? */1148 if (nwnd != NULL && (nwnd->flags & ~allowed_flags) == 0) {1149 return nwnd;1150 }1151 1152 /* Try succeeding windows in display order */1153 nwnd = ds_display_last_window(wnd->display);1154 while (nwnd != NULL && nwnd != wnd &&1155 (nwnd->flags & ~allowed_flags) != 0) {1156 nwnd = ds_display_prev_window(nwnd);1157 }1158 1159 if (nwnd == wnd)1160 return NULL;1161 1162 return nwnd;1163 }1164 1165 /** Remove focus from window.1166 *1167 * Used to switch focus to another window when closing or minimizing window.1168 *1169 * @param wnd Window1170 */1171 void ds_window_unfocus(ds_window_t *wnd)1172 {1173 ds_seat_t *seat;1174 1175 /* Make sure window is no longer focused in any seat */1176 seat = ds_display_first_seat(wnd->display);1177 while (seat != NULL) {1178 ds_seat_unfocus_wnd(seat, wnd);1179 seat = ds_display_next_seat(seat);1180 }1181 }1182 1183 /** Determine if input device belongs to the same seat as the original device.1184 *1185 * Compare the seat ownning @a idev_id with the seat owning @a wnd->orig_pos_id1186 * (the device that started the window move or resize).1187 *1188 * This is used to make sure that, when two seats focus the same window,1189 * only devices owned by the seat that started the resize or move can1190 * affect it. Otherwise moving the other pointer(s) would disrupt the1191 * resize or move operation.1192 *1193 * @param wnd Window (that is currently being resized or moved)1194 * @param idev_id Input device ID1195 * @return @c true iff idev_id is owned by the same seat as the input1196 * device that started the resize or move1197 */1198 bool ds_window_orig_seat(ds_window_t *wnd, sysarg_t idev_id)1199 {1200 ds_seat_t *orig_seat;1201 ds_seat_t *seat;1202 1203 /* Window must be in state such that wnd->orig_pos_id is valid */1204 assert(wnd->state == dsw_moving || wnd->state == dsw_resizing);1205 1206 orig_seat = ds_display_seat_by_idev(wnd->display, wnd->orig_pos_id);1207 seat = ds_display_seat_by_idev(wnd->display, idev_id);1208 1209 return seat == orig_seat;1210 }1211 1212 822 /** Window memory GC invalidate callback. 1213 823 *
Note:
See TracChangeset
for help on using the changeset viewer.