Changeset 9901f267 in mainline for uspace/srv/hid/display/window.c


Ignore:
Timestamp:
2020-05-22T10:38:52Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ef20a91
Parents:
9242ad9
git-author:
Jiri Svoboda <jiri@…> (2020-05-21 17:38:41)
git-committer:
Jiri Svoboda <jiri@…> (2020-05-22 10:38:52)
Message:

Display server needs to override cursor when resizing windows

Although the pointer moves, the window is not resized until button
is released. Therefore we need override the cursor from what it
would be just based on where the pointer is located.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/display/window.c

    r9242ad9 r9901f267  
    4545#include "client.h"
    4646#include "display.h"
     47#include "seat.h"
    4748#include "window.h"
    4849
     
    515516    display_wnd_rsztype_t rsztype, gfx_coord2_t *pos)
    516517{
     518        ds_seat_t *seat;
     519        display_stock_cursor_t ctype;
     520
    517521        log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_start_resize (%d, %d)",
    518522            (int) pos->x, (int) pos->y);
     
    525529        wnd->rsztype = rsztype;
    526530        wnd->preview_rect = wnd->rect;
     531
     532        // XXX Need client to tell us which seat started the resize!
     533        seat = ds_display_first_seat(wnd->display);
     534        ctype = display_cursor_from_wrsz(rsztype);
     535        ds_seat_set_wm_cursor(seat, wnd->display->cursor[ctype]);
    527536}
    528537
     
    536545        gfx_coord2_t dresize;
    537546        gfx_rect_t nrect;
     547        ds_seat_t *seat;
    538548
    539549        log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_finish_resize (%d, %d)",
     
    552562        wnd->state = dsw_idle;
    553563        ds_client_post_resize_event(wnd->client, wnd, &nrect);
     564
     565        // XXX Need to know which seat started the resize!
     566        seat = ds_display_first_seat(wnd->display);
     567        ds_seat_set_wm_cursor(seat, NULL);
    554568}
    555569
Note: See TracChangeset for help on using the changeset viewer.