diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/xterm.c b/src/xterm.c index 801a9641051..342f2b044f9 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -15812,7 +15812,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 15812 | int y = event->xbutton.y; | 15812 | int y = event->xbutton.y; |
| 15813 | 15813 | ||
| 15814 | window = window_from_coordinates (f, x, y, 0, true, true); | 15814 | window = window_from_coordinates (f, x, y, 0, true, true); |
| 15815 | tool_bar_p = EQ (window, f->tool_bar_window); | 15815 | tool_bar_p = (EQ (window, f->tool_bar_window) |
| 15816 | && (event->xbutton.type != ButtonRelease | ||
| 15817 | || f->last_tool_bar_item != -1)); | ||
| 15816 | 15818 | ||
| 15817 | if (tool_bar_p && event->xbutton.button < 4) | 15819 | if (tool_bar_p && event->xbutton.button < 4) |
| 15818 | handle_tool_bar_click | 15820 | handle_tool_bar_click |
| @@ -17200,7 +17202,16 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 17200 | int y = bv.y; | 17202 | int y = bv.y; |
| 17201 | 17203 | ||
| 17202 | window = window_from_coordinates (f, x, y, 0, true, true); | 17204 | window = window_from_coordinates (f, x, y, 0, true, true); |
| 17203 | tool_bar_p = EQ (window, f->tool_bar_window); | 17205 | /* Ignore button release events if the mouse |
| 17206 | wasn't previously pressed on the tool bar. | ||
| 17207 | We do this because otherwise selecting some | ||
| 17208 | text with the mouse and then releasing it on | ||
| 17209 | the tool bar doesn't stop selecting text, | ||
| 17210 | since the tool bar eats the button up | ||
| 17211 | event. */ | ||
| 17212 | tool_bar_p = (EQ (window, f->tool_bar_window) | ||
| 17213 | && (xev->evtype != XI_ButtonRelease | ||
| 17214 | || f->last_tool_bar_item != -1)); | ||
| 17204 | 17215 | ||
| 17205 | if (tool_bar_p && xev->detail < 4) | 17216 | if (tool_bar_p && xev->detail < 4) |
| 17206 | handle_tool_bar_click_with_device | 17217 | handle_tool_bar_click_with_device |