[cf32dbd] | 1 | /*
|
---|
| 2 | * Copyright (c) 2019 Jiri Svoboda
|
---|
| 3 | * All rights reserved.
|
---|
| 4 | *
|
---|
| 5 | * Redistribution and use in source and binary forms, with or without
|
---|
| 6 | * modification, are permitted provided that the following conditions
|
---|
| 7 | * are met:
|
---|
| 8 | *
|
---|
| 9 | * - Redistributions of source code must retain the above copyright
|
---|
| 10 | * notice, this list of conditions and the following disclaimer.
|
---|
| 11 | * - Redistributions in binary form must reproduce the above copyright
|
---|
| 12 | * notice, this list of conditions and the following disclaimer in the
|
---|
| 13 | * documentation and/or other materials provided with the distribution.
|
---|
| 14 | * - The name of the author may not be used to endorse or promote products
|
---|
| 15 | * derived from this software without specific prior written permission.
|
---|
| 16 | *
|
---|
| 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
---|
| 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
| 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
---|
| 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
---|
| 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
---|
| 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
---|
| 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
---|
| 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
---|
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
| 27 | */
|
---|
| 28 |
|
---|
| 29 | /** @addtogroup display
|
---|
| 30 | * @{
|
---|
| 31 | */
|
---|
| 32 | /**
|
---|
| 33 | * @file Display server seat
|
---|
| 34 | */
|
---|
| 35 |
|
---|
| 36 | #include <adt/list.h>
|
---|
| 37 | #include <errno.h>
|
---|
[4fbdc3d] | 38 | #include <gfx/color.h>
|
---|
| 39 | #include <gfx/render.h>
|
---|
[cf32dbd] | 40 | #include <stdlib.h>
|
---|
| 41 | #include "client.h"
|
---|
[4d8002d] | 42 | #include "cursor.h"
|
---|
[cf32dbd] | 43 | #include "display.h"
|
---|
| 44 | #include "seat.h"
|
---|
| 45 | #include "window.h"
|
---|
| 46 |
|
---|
[978c9bc5] | 47 | static void ds_seat_get_pointer_rect(ds_seat_t *, gfx_rect_t *);
|
---|
| 48 | static errno_t ds_seat_repaint_pointer(ds_seat_t *, gfx_rect_t *);
|
---|
[9901f267] | 49 |
|
---|
[cf32dbd] | 50 | /** Create seat.
|
---|
| 51 | *
|
---|
| 52 | * @param display Parent display
|
---|
| 53 | * @param rseat Place to store pointer to new seat.
|
---|
| 54 | * @return EOK on success, ENOMEM if out of memory
|
---|
| 55 | */
|
---|
| 56 | errno_t ds_seat_create(ds_display_t *display, ds_seat_t **rseat)
|
---|
| 57 | {
|
---|
| 58 | ds_seat_t *seat;
|
---|
| 59 |
|
---|
| 60 | seat = calloc(1, sizeof(ds_seat_t));
|
---|
| 61 | if (seat == NULL)
|
---|
| 62 | return ENOMEM;
|
---|
| 63 |
|
---|
| 64 | ds_display_add_seat(display, seat);
|
---|
[c2250702] | 65 | seat->pntpos.x = 0;
|
---|
| 66 | seat->pntpos.y = 0;
|
---|
[cf32dbd] | 67 |
|
---|
[9901f267] | 68 | seat->client_cursor = display->cursor[dcurs_arrow];
|
---|
| 69 | seat->wm_cursor = NULL;
|
---|
[4d8002d] | 70 |
|
---|
[cf32dbd] | 71 | *rseat = seat;
|
---|
| 72 | return EOK;
|
---|
| 73 | }
|
---|
| 74 |
|
---|
| 75 | /** Destroy seat.
|
---|
| 76 | *
|
---|
| 77 | * @param seat Seat
|
---|
| 78 | */
|
---|
| 79 | void ds_seat_destroy(ds_seat_t *seat)
|
---|
| 80 | {
|
---|
| 81 | ds_display_remove_seat(seat);
|
---|
| 82 | free(seat);
|
---|
| 83 | }
|
---|
| 84 |
|
---|
[4fbdc3d] | 85 | /** Set seat focus to a window.
|
---|
| 86 | *
|
---|
| 87 | * @param seat Seat
|
---|
| 88 | * @param wnd Window to focus
|
---|
| 89 | */
|
---|
[cf32dbd] | 90 | void ds_seat_set_focus(ds_seat_t *seat, ds_window_t *wnd)
|
---|
| 91 | {
|
---|
[554a5f1] | 92 | if (wnd == seat->focus) {
|
---|
| 93 | /* Focus is not changing */
|
---|
| 94 | return;
|
---|
| 95 | }
|
---|
| 96 |
|
---|
[b0a94854] | 97 | if (seat->focus != NULL)
|
---|
| 98 | ds_window_post_unfocus_event(seat->focus);
|
---|
| 99 |
|
---|
[cf32dbd] | 100 | seat->focus = wnd;
|
---|
[b0a94854] | 101 |
|
---|
[ef30659] | 102 | if (wnd != NULL) {
|
---|
[b0a94854] | 103 | ds_window_post_focus_event(wnd);
|
---|
[ef30659] | 104 | ds_window_bring_to_top(wnd);
|
---|
| 105 | }
|
---|
[cf32dbd] | 106 | }
|
---|
| 107 |
|
---|
[4fbdc3d] | 108 | /** Evacuate focus from window.
|
---|
| 109 | *
|
---|
| 110 | * If seat's focus is @a wnd, it will be set to a different window.
|
---|
| 111 | *
|
---|
| 112 | * @param seat Seat
|
---|
| 113 | * @param wnd Window to evacuate focus from
|
---|
| 114 | */
|
---|
[cf32dbd] | 115 | void ds_seat_evac_focus(ds_seat_t *seat, ds_window_t *wnd)
|
---|
| 116 | {
|
---|
| 117 | ds_window_t *nwnd;
|
---|
| 118 |
|
---|
| 119 | if (seat->focus == wnd) {
|
---|
[08f345f] | 120 | nwnd = ds_display_prev_window(wnd);
|
---|
[cf32dbd] | 121 | if (nwnd == NULL)
|
---|
[08f345f] | 122 | nwnd = ds_display_last_window(wnd->display);
|
---|
[cf32dbd] | 123 | if (nwnd == wnd)
|
---|
| 124 | nwnd = NULL;
|
---|
| 125 |
|
---|
| 126 | ds_seat_set_focus(seat, nwnd);
|
---|
| 127 | }
|
---|
| 128 | }
|
---|
| 129 |
|
---|
[0da03df] | 130 | /** Switch focus to another window.
|
---|
| 131 | *
|
---|
| 132 | * @param seat Seat
|
---|
| 133 | * @param wnd Window to evacuate focus from
|
---|
| 134 | */
|
---|
| 135 | void ds_seat_switch_focus(ds_seat_t *seat)
|
---|
| 136 | {
|
---|
| 137 | ds_window_t *nwnd;
|
---|
| 138 |
|
---|
| 139 | if (seat->focus != NULL)
|
---|
| 140 | nwnd = ds_display_prev_window(seat->focus);
|
---|
| 141 | else
|
---|
| 142 | nwnd = NULL;
|
---|
| 143 |
|
---|
| 144 | if (nwnd == NULL)
|
---|
| 145 | nwnd = ds_display_last_window(seat->display);
|
---|
| 146 |
|
---|
| 147 | if (nwnd != NULL)
|
---|
| 148 | ds_seat_set_focus(seat, nwnd);
|
---|
| 149 | }
|
---|
| 150 |
|
---|
[cf32dbd] | 151 | /** Post keyboard event to the seat's focused window.
|
---|
| 152 | *
|
---|
| 153 | * @param seat Seat
|
---|
| 154 | * @param event Event
|
---|
| 155 | *
|
---|
| 156 | * @return EOK on success or an error code
|
---|
| 157 | */
|
---|
| 158 | errno_t ds_seat_post_kbd_event(ds_seat_t *seat, kbd_event_t *event)
|
---|
| 159 | {
|
---|
[79949f3] | 160 | ds_window_t *dwindow;
|
---|
| 161 | bool alt_or_shift;
|
---|
[cf32dbd] | 162 |
|
---|
[79949f3] | 163 | alt_or_shift = event->mods & (KM_SHIFT | KM_ALT);
|
---|
| 164 | if (event->type == KEY_PRESS && alt_or_shift && event->key == KC_TAB) {
|
---|
| 165 | /* On Alt-Tab or Shift-Tab, switch focus to next window */
|
---|
[0da03df] | 166 | ds_seat_switch_focus(seat);
|
---|
[79949f3] | 167 | return EOK;
|
---|
| 168 | }
|
---|
| 169 |
|
---|
| 170 | dwindow = seat->focus;
|
---|
[cf32dbd] | 171 | if (dwindow == NULL)
|
---|
| 172 | return EOK;
|
---|
| 173 |
|
---|
[338d0935] | 174 | return ds_window_post_kbd_event(dwindow, event);
|
---|
[cf32dbd] | 175 | }
|
---|
| 176 |
|
---|
[9901f267] | 177 | /** Get current cursor used by seat.
|
---|
| 178 | *
|
---|
| 179 | * @param wmcurs WM curor
|
---|
| 180 | * @param ccurs Client cursor
|
---|
| 181 | * @return
|
---|
| 182 | */
|
---|
| 183 | static ds_cursor_t *ds_seat_compute_cursor(ds_cursor_t *wmcurs, ds_cursor_t *ccurs)
|
---|
| 184 | {
|
---|
| 185 | if (wmcurs != NULL)
|
---|
| 186 | return wmcurs;
|
---|
| 187 |
|
---|
| 188 | return ccurs;
|
---|
| 189 | }
|
---|
| 190 |
|
---|
| 191 | /** Get current cursor used by seat.
|
---|
| 192 | *
|
---|
| 193 | * @param seat Seat
|
---|
| 194 | * @return Current cursor
|
---|
| 195 | */
|
---|
| 196 | static ds_cursor_t *ds_seat_get_cursor(ds_seat_t *seat)
|
---|
| 197 | {
|
---|
| 198 | return ds_seat_compute_cursor(seat->wm_cursor, seat->client_cursor);
|
---|
| 199 | }
|
---|
| 200 |
|
---|
| 201 | /** Set client cursor.
|
---|
| 202 | *
|
---|
| 203 | * Set cursor selected by client. This may update the actual cursor
|
---|
| 204 | * if WM is not overriding the cursor.
|
---|
| 205 | *
|
---|
| 206 | * @param seat Seat
|
---|
| 207 | * @param cursor Client cursor
|
---|
| 208 | */
|
---|
| 209 | static void ds_seat_set_client_cursor(ds_seat_t *seat, ds_cursor_t *cursor)
|
---|
| 210 | {
|
---|
| 211 | ds_cursor_t *old_cursor;
|
---|
| 212 | ds_cursor_t *new_cursor;
|
---|
[978c9bc5] | 213 | gfx_rect_t old_rect;
|
---|
[9901f267] | 214 |
|
---|
| 215 | old_cursor = ds_seat_get_cursor(seat);
|
---|
| 216 | new_cursor = ds_seat_compute_cursor(seat->wm_cursor, cursor);
|
---|
| 217 |
|
---|
[978c9bc5] | 218 | if (new_cursor != old_cursor) {
|
---|
| 219 | ds_seat_get_pointer_rect(seat, &old_rect);
|
---|
| 220 | seat->client_cursor = cursor;
|
---|
| 221 | ds_seat_repaint_pointer(seat, &old_rect);
|
---|
| 222 | } else {
|
---|
| 223 | seat->client_cursor = cursor;
|
---|
| 224 | }
|
---|
[9901f267] | 225 | }
|
---|
| 226 |
|
---|
| 227 | /** Set WM cursor.
|
---|
| 228 | *
|
---|
| 229 | * Set cursor override for window management.
|
---|
| 230 | *
|
---|
| 231 | * @param seat Seat
|
---|
| 232 | * @param cursor WM cursor override or @c NULL not to override the cursor
|
---|
| 233 | */
|
---|
| 234 | void ds_seat_set_wm_cursor(ds_seat_t *seat, ds_cursor_t *cursor)
|
---|
| 235 | {
|
---|
| 236 | ds_cursor_t *old_cursor;
|
---|
| 237 | ds_cursor_t *new_cursor;
|
---|
[978c9bc5] | 238 | gfx_rect_t old_rect;
|
---|
[9901f267] | 239 |
|
---|
| 240 | old_cursor = ds_seat_get_cursor(seat);
|
---|
| 241 | new_cursor = ds_seat_compute_cursor(cursor, seat->client_cursor);
|
---|
| 242 |
|
---|
[978c9bc5] | 243 | if (new_cursor != old_cursor) {
|
---|
| 244 | ds_seat_get_pointer_rect(seat, &old_rect);
|
---|
| 245 | seat->wm_cursor = cursor;
|
---|
| 246 | ds_seat_repaint_pointer(seat, &old_rect);
|
---|
| 247 | } else {
|
---|
| 248 | seat->wm_cursor = cursor;
|
---|
| 249 | }
|
---|
[9901f267] | 250 | }
|
---|
| 251 |
|
---|
[978c9bc5] | 252 | /** Get rectangle covered by pointer.
|
---|
[4fbdc3d] | 253 | *
|
---|
| 254 | * @param seat Seat
|
---|
[978c9bc5] | 255 | * @param rect Place to store rectangle
|
---|
[4fbdc3d] | 256 | */
|
---|
[978c9bc5] | 257 | void ds_seat_get_pointer_rect(ds_seat_t *seat, gfx_rect_t *rect)
|
---|
[4fbdc3d] | 258 | {
|
---|
[9901f267] | 259 | ds_cursor_t *cursor;
|
---|
| 260 |
|
---|
| 261 | cursor = ds_seat_get_cursor(seat);
|
---|
[978c9bc5] | 262 | ds_cursor_get_rect(cursor, &seat->pntpos, rect);
|
---|
[4fbdc3d] | 263 | }
|
---|
| 264 |
|
---|
[978c9bc5] | 265 | /** Repaint seat pointer
|
---|
| 266 | *
|
---|
| 267 | * Repaint the pointer after it has moved or changed. This is done by
|
---|
[d70e7b7b] | 268 | * repainting the area of the display previously (@a old_rect) and currently
|
---|
[978c9bc5] | 269 | * covered by the pointer.
|
---|
[28db46b] | 270 | *
|
---|
| 271 | * @param seat Seat
|
---|
[978c9bc5] | 272 | * @param old_rect Rectangle previously covered by pointer
|
---|
[28db46b] | 273 | *
|
---|
| 274 | * @return EOK on success or an error code
|
---|
| 275 | */
|
---|
[978c9bc5] | 276 | static errno_t ds_seat_repaint_pointer(ds_seat_t *seat, gfx_rect_t *old_rect)
|
---|
[28db46b] | 277 | {
|
---|
[978c9bc5] | 278 | gfx_rect_t new_rect;
|
---|
| 279 | gfx_rect_t envelope;
|
---|
| 280 | errno_t rc;
|
---|
[9901f267] | 281 |
|
---|
[978c9bc5] | 282 | ds_seat_get_pointer_rect(seat, &new_rect);
|
---|
[28db46b] | 283 |
|
---|
[6301a24f] | 284 | if (gfx_rect_is_incident(old_rect, &new_rect)) {
|
---|
[978c9bc5] | 285 | /* Rectangles do not intersect. Repaint them separately. */
|
---|
| 286 | rc = ds_display_paint(seat->display, &new_rect);
|
---|
| 287 | if (rc != EOK)
|
---|
| 288 | return rc;
|
---|
[28db46b] | 289 |
|
---|
[978c9bc5] | 290 | rc = ds_display_paint(seat->display, old_rect);
|
---|
| 291 | if (rc != EOK)
|
---|
| 292 | return rc;
|
---|
| 293 | } else {
|
---|
| 294 | /*
|
---|
| 295 | * Rectangles intersect. As an optimization, repaint them
|
---|
| 296 | * in a single operation.
|
---|
| 297 | */
|
---|
| 298 | gfx_rect_envelope(old_rect, &new_rect, &envelope);
|
---|
| 299 |
|
---|
| 300 | rc = ds_display_paint(seat->display, &envelope);
|
---|
| 301 | if (rc != EOK)
|
---|
| 302 | return rc;
|
---|
| 303 | }
|
---|
| 304 |
|
---|
| 305 | return EOK;
|
---|
[28db46b] | 306 | }
|
---|
| 307 |
|
---|
[4fbdc3d] | 308 | /** Post pointing device event to the seat
|
---|
[a40ae0d] | 309 | *
|
---|
| 310 | * Update pointer position and generate position event.
|
---|
[4fbdc3d] | 311 | *
|
---|
| 312 | * @param seat Seat
|
---|
| 313 | * @param event Event
|
---|
| 314 | *
|
---|
| 315 | * @return EOK on success or an error code
|
---|
| 316 | */
|
---|
| 317 | errno_t ds_seat_post_ptd_event(ds_seat_t *seat, ptd_event_t *event)
|
---|
| 318 | {
|
---|
[e1f2079] | 319 | ds_display_t *disp = seat->display;
|
---|
[4fbdc3d] | 320 | gfx_coord2_t npos;
|
---|
[978c9bc5] | 321 | gfx_rect_t old_rect;
|
---|
[a40ae0d] | 322 | ds_window_t *wnd;
|
---|
| 323 | pos_event_t pevent;
|
---|
| 324 | errno_t rc;
|
---|
[4fbdc3d] | 325 |
|
---|
[a40ae0d] | 326 | wnd = ds_display_window_by_pos(seat->display, &seat->pntpos);
|
---|
| 327 |
|
---|
[4fbdc3d] | 328 | /* Focus window on button press */
|
---|
[a40ae0d] | 329 | if (event->type == PTD_PRESS && event->btn_num == 1) {
|
---|
[4fbdc3d] | 330 | if (wnd != NULL) {
|
---|
| 331 | ds_seat_set_focus(seat, wnd);
|
---|
| 332 | }
|
---|
| 333 | }
|
---|
| 334 |
|
---|
[a40ae0d] | 335 | if (event->type == PTD_PRESS || event->type == PTD_RELEASE) {
|
---|
| 336 | pevent.pos_id = 0;
|
---|
| 337 | pevent.type = (event->type == PTD_PRESS) ?
|
---|
| 338 | POS_PRESS : POS_RELEASE;
|
---|
| 339 | pevent.btn_num = event->btn_num;
|
---|
| 340 | pevent.hpos = seat->pntpos.x;
|
---|
| 341 | pevent.vpos = seat->pntpos.y;
|
---|
| 342 |
|
---|
| 343 | rc = ds_seat_post_pos_event(seat, &pevent);
|
---|
| 344 | if (rc != EOK)
|
---|
| 345 | return rc;
|
---|
| 346 | }
|
---|
| 347 |
|
---|
[4fbdc3d] | 348 | if (event->type == PTD_MOVE) {
|
---|
| 349 | gfx_coord2_add(&seat->pntpos, &event->dmove, &npos);
|
---|
[e1f2079] | 350 | gfx_coord2_clip(&npos, &disp->rect, &npos);
|
---|
[4fbdc3d] | 351 |
|
---|
[978c9bc5] | 352 | ds_seat_get_pointer_rect(seat, &old_rect);
|
---|
[4fbdc3d] | 353 | seat->pntpos = npos;
|
---|
[a40ae0d] | 354 |
|
---|
| 355 | pevent.pos_id = 0;
|
---|
| 356 | pevent.type = POS_UPDATE;
|
---|
| 357 | pevent.btn_num = 0;
|
---|
| 358 | pevent.hpos = seat->pntpos.x;
|
---|
| 359 | pevent.vpos = seat->pntpos.y;
|
---|
| 360 |
|
---|
| 361 | rc = ds_seat_post_pos_event(seat, &pevent);
|
---|
| 362 | if (rc != EOK)
|
---|
| 363 | return rc;
|
---|
| 364 |
|
---|
[978c9bc5] | 365 | ds_seat_repaint_pointer(seat, &old_rect);
|
---|
[4fbdc3d] | 366 | }
|
---|
| 367 |
|
---|
[1388f7f0] | 368 | if (event->type == PTD_ABS_MOVE) {
|
---|
| 369 | /*
|
---|
| 370 | * Project input device area onto display area. Technically
|
---|
| 371 | * we probably want to project onto the area of a particular
|
---|
| 372 | * display device. The tricky part is figuring out which
|
---|
| 373 | * display device the input device is associated with.
|
---|
| 374 | */
|
---|
| 375 | gfx_coord2_project(&event->apos, &event->abounds,
|
---|
| 376 | &disp->rect, &npos);
|
---|
| 377 |
|
---|
| 378 | gfx_coord2_clip(&npos, &disp->rect, &npos);
|
---|
| 379 |
|
---|
[978c9bc5] | 380 | ds_seat_get_pointer_rect(seat, &old_rect);
|
---|
[1388f7f0] | 381 | seat->pntpos = npos;
|
---|
| 382 |
|
---|
| 383 | pevent.pos_id = 0;
|
---|
| 384 | pevent.type = POS_UPDATE;
|
---|
| 385 | pevent.btn_num = 0;
|
---|
| 386 | pevent.hpos = seat->pntpos.x;
|
---|
| 387 | pevent.vpos = seat->pntpos.y;
|
---|
| 388 |
|
---|
| 389 | rc = ds_seat_post_pos_event(seat, &pevent);
|
---|
| 390 | if (rc != EOK)
|
---|
| 391 | return rc;
|
---|
| 392 |
|
---|
[978c9bc5] | 393 | ds_seat_repaint_pointer(seat, &old_rect);
|
---|
[1388f7f0] | 394 | }
|
---|
| 395 |
|
---|
[4fbdc3d] | 396 | return EOK;
|
---|
| 397 | }
|
---|
| 398 |
|
---|
[a40ae0d] | 399 | /** Post position event to seat.
|
---|
| 400 | *
|
---|
| 401 | * Deliver event to relevant windows.
|
---|
| 402 | *
|
---|
| 403 | * @param seat Seat
|
---|
| 404 | * @param event Position event
|
---|
| 405 | */
|
---|
| 406 | errno_t ds_seat_post_pos_event(ds_seat_t *seat, pos_event_t *event)
|
---|
| 407 | {
|
---|
| 408 | ds_window_t *wnd;
|
---|
| 409 | errno_t rc;
|
---|
| 410 |
|
---|
| 411 | wnd = ds_display_window_by_pos(seat->display, &seat->pntpos);
|
---|
[0da03df] | 412 | if (seat->focus != wnd && seat->focus != NULL) {
|
---|
[bc492d5] | 413 | rc = ds_window_post_pos_event(seat->focus, event);
|
---|
| 414 | if (rc != EOK)
|
---|
| 415 | return rc;
|
---|
| 416 |
|
---|
| 417 | /* Only deliver release events to the focused window */
|
---|
| 418 | if (event->type == POS_RELEASE)
|
---|
| 419 | return EOK;
|
---|
| 420 | }
|
---|
| 421 |
|
---|
[a40ae0d] | 422 | if (wnd != NULL) {
|
---|
[9242ad9] | 423 | /* Moving over a window */
|
---|
[9901f267] | 424 | ds_seat_set_client_cursor(seat, wnd->cursor);
|
---|
[9242ad9] | 425 |
|
---|
[a40ae0d] | 426 | rc = ds_window_post_pos_event(wnd, event);
|
---|
| 427 | if (rc != EOK)
|
---|
| 428 | return rc;
|
---|
[9242ad9] | 429 | } else {
|
---|
| 430 | /* Not over a window */
|
---|
[9901f267] | 431 | ds_seat_set_client_cursor(seat, seat->display->cursor[dcurs_arrow]);
|
---|
[a40ae0d] | 432 | }
|
---|
| 433 |
|
---|
| 434 | return EOK;
|
---|
| 435 | }
|
---|
| 436 |
|
---|
[978c9bc5] | 437 | /** Paint seat pointer.
|
---|
| 438 | *
|
---|
| 439 | * @param seat Seat whose pointer to paint
|
---|
| 440 | * @param rect Clipping rectangle
|
---|
| 441 | */
|
---|
| 442 | errno_t ds_seat_paint_pointer(ds_seat_t *seat, gfx_rect_t *rect)
|
---|
| 443 | {
|
---|
| 444 | ds_cursor_t *cursor;
|
---|
| 445 |
|
---|
| 446 | cursor = ds_seat_get_cursor(seat);
|
---|
[62018a0] | 447 | return ds_cursor_paint(cursor, &seat->pntpos, rect);
|
---|
[978c9bc5] | 448 | }
|
---|
| 449 |
|
---|
[cf32dbd] | 450 | /** @}
|
---|
| 451 | */
|
---|