|
|
@ -781,25 +781,39 @@ weston_wm_handle_button(struct weston_wm *wm, xcb_generic_event_t *event) |
|
|
|
struct weston_wm_window *window; |
|
|
|
struct weston_wm_window *window; |
|
|
|
enum theme_location location; |
|
|
|
enum theme_location location; |
|
|
|
struct theme *t = wm->theme; |
|
|
|
struct theme *t = wm->theme; |
|
|
|
|
|
|
|
int width, height; |
|
|
|
|
|
|
|
|
|
|
|
fprintf(stderr, "XCB_BUTTON_%s (detail %d)\n", |
|
|
|
fprintf(stderr, "XCB_BUTTON_%s (detail %d)\n", |
|
|
|
button->response_type == XCB_BUTTON_PRESS ? |
|
|
|
button->response_type == XCB_BUTTON_PRESS ? |
|
|
|
"PRESS" : "RELEASE", button->detail); |
|
|
|
"PRESS" : "RELEASE", button->detail); |
|
|
|
|
|
|
|
|
|
|
|
window = hash_table_lookup(wm->window_hash, button->event); |
|
|
|
window = hash_table_lookup(wm->window_hash, button->event); |
|
|
|
|
|
|
|
weston_wm_window_get_frame_size(window, &width, &height); |
|
|
|
|
|
|
|
|
|
|
|
if (button->response_type == XCB_BUTTON_PRESS && |
|
|
|
if (button->response_type == XCB_BUTTON_PRESS && |
|
|
|
button->detail == 1) { |
|
|
|
button->detail == 1) { |
|
|
|
location = theme_get_location(t, |
|
|
|
location = theme_get_location(t, |
|
|
|
button->event_x, |
|
|
|
button->event_x, |
|
|
|
button->event_y, |
|
|
|
button->event_y, |
|
|
|
window->width, |
|
|
|
width, height); |
|
|
|
window->height); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (location) { |
|
|
|
switch (location) { |
|
|
|
case THEME_LOCATION_TITLEBAR: |
|
|
|
case THEME_LOCATION_TITLEBAR: |
|
|
|
shell_interface->move(window->shsurf, |
|
|
|
shell_interface->move(window->shsurf, |
|
|
|
wm->server->compositor->seat); |
|
|
|
wm->server->compositor->seat); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case THEME_LOCATION_RESIZING_TOP: |
|
|
|
|
|
|
|
case THEME_LOCATION_RESIZING_BOTTOM: |
|
|
|
|
|
|
|
case THEME_LOCATION_RESIZING_LEFT: |
|
|
|
|
|
|
|
case THEME_LOCATION_RESIZING_RIGHT: |
|
|
|
|
|
|
|
case THEME_LOCATION_RESIZING_TOP_LEFT: |
|
|
|
|
|
|
|
case THEME_LOCATION_RESIZING_TOP_RIGHT: |
|
|
|
|
|
|
|
case THEME_LOCATION_RESIZING_BOTTOM_LEFT: |
|
|
|
|
|
|
|
case THEME_LOCATION_RESIZING_BOTTOM_RIGHT: |
|
|
|
|
|
|
|
shell_interface->resize(window->shsurf, |
|
|
|
|
|
|
|
wm->server->compositor->seat, |
|
|
|
|
|
|
|
location); |
|
|
|
|
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|