multi-seat: improve handling of multiple (mouse) pointers

* xcursor always set for all pointers
* xcursor sometimes not updated when it should be
* mouse grabbed state wasn't per seat, but global (i.e. "does at least
  one seat enable mouse grabbing")
* selection enabled state wasn't per seat
This commit is contained in:
Daniel Eklöf 2020-07-09 09:52:11 +02:00
parent 699cbaf380
commit 4e48d550ef
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
8 changed files with 97 additions and 90 deletions

View file

@ -305,7 +305,6 @@ struct terminal {
uint32_t text;
uint32_t cursor;
} cursor_color;
const char *xcursor;
struct {
enum selection_kind kind;
@ -439,6 +438,18 @@ struct terminal {
char *cwd;
};
extern const char *const XCURSOR_LEFT_PTR;
extern const char *const XCURSOR_TEXT;
//extern const char *const XCURSOR_HAND2;
extern const char *const XCURSOR_TOP_LEFT_CORNER;
extern const char *const XCURSOR_TOP_RIGHT_CORNER;
extern const char *const XCURSOR_BOTTOM_LEFT_CORNER;
extern const char *const XCURSOR_BOTTOM_RIGHT_CORNER;
extern const char *const XCURSOR_LEFT_SIDE;
extern const char *const XCURSOR_RIGHT_SIDE;
extern const char *const XCURSOR_TOP_SIDE;
extern const char *const XCURSOR_BOTTOM_SIDE;
struct config;
struct terminal *term_init(
const struct config *conf, struct fdm *fdm, struct reaper *reaper,
@ -518,7 +529,7 @@ void term_mouse_up(
void term_mouse_motion(
struct terminal *term, int button, int row, int col,
bool shift, bool alt, bool ctrl);
bool term_mouse_grabbed(const struct terminal *term);
bool term_mouse_grabbed(const struct terminal *term, struct seat *seat);
void term_xcursor_update(struct terminal *term);
void term_set_window_title(struct terminal *term, const char *title);