Lisp_Object window
= window_from_coordinates (f, event->xmotion.x,
event->xmotion.y, 0,
- false, false);
+ false, false, false);
/* A window will be autoselected only when it is not
selected now and the last mouse movement event was
int x = event->xbutton.x;
int y = event->xbutton.y;
- window = window_from_coordinates (f, x, y, 0, true, true);
+ window = window_from_coordinates (f, x, y, 0, true, true, true);
tab_bar_p = EQ (window, f->tab_bar_window);
if (tab_bar_p)
int x = event->xbutton.x;
int y = event->xbutton.y;
- window = window_from_coordinates (f, x, y, 0, true, true);
+ window = window_from_coordinates (f, x, y, 0, true, true, true);
tool_bar_p = (EQ (window, f->tool_bar_window)
&& ((event->xbutton.type
!= ANDROID_BUTTON_RELEASE)
int y = event->touch.y;
window = window_from_coordinates (any, x, y, 0, true,
- true);
+ true, true);
/* If this touch has started in the tool bar, do not
send it to Lisp. Instead, simulate a tool bar
/* Figure out how much to scale the deltas by. */
window = window_from_coordinates (any, event->wheel.x,
event->wheel.y, NULL,
- false, false);
+ false, false, false);
if (WINDOWP (window))
scroll_height = XWINDOW (window)->pixel_height;
if (!NILP (Vmouse_autoselect_window))
{
static Lisp_Object last_mouse_window;
- Lisp_Object window = window_from_coordinates (f, b->x, b->y, 0, 0, 0);
+ Lisp_Object window = window_from_coordinates (f, b->x, b->y, 0, 0, 0, 0);
if (WINDOWP (window)
&& !EQ (window, last_mouse_window)
int x = b->x;
int y = b->y;
- window = window_from_coordinates (f, x, y, 0, true, true);
+ window = window_from_coordinates (f, x, y, 0, true, true, true);
tab_bar_p = EQ (window, f->tab_bar_window);
if (tab_bar_p)
int x = b->x;
int y = b->y;
- window = window_from_coordinates (f, x, y, 0, true, true);
+ window = window_from_coordinates (f, x, y, 0, true, true, true);
tool_bar_p = (EQ (window, f->tool_bar_window)
&& (type != BUTTON_UP
|| f->last_tool_bar_item != -1));
BView_get_mouse (FRAME_HAIKU_VIEW (f), &x, &y);
- wheel_window = window_from_coordinates (f, x, y, 0, false, false);
+ wheel_window = window_from_coordinates (f, x, y, 0, false, false, false);
if (NILP (wheel_window))
{
int xret = 0, yret = 0;
/* The window or frame under frame pixel coordinates (x,y) */
Lisp_Object window_or_frame = f
- ? window_from_coordinates (f, mx, my, &part, true, true)
+ ? window_from_coordinates (f, mx, my, &part, true, true, true)
: Qnil;
#ifdef HAVE_WINDOW_SYSTEM
bool tool_bar_p = false;
static Lisp_Object last_mouse_window;
mouse_window = window_from_coordinates
- (SELECTED_FRAME (), mouse_last_x, mouse_last_y, 0, 0, 0);
+ (SELECTED_FRAME (), mouse_last_x, mouse_last_y, 0, 0, 0, 0);
/* A window will be selected only when it is not
selected now, and the last mouse movement event was
not in it. A minibuffer window will be selected iff
int x = lrint (p.x);
int y = lrint (p.y);
- window = window_from_coordinates (emacsframe, x, y, 0, true, true);
+ window = window_from_coordinates (emacsframe, x, y, 0, true, true, true);
tab_bar_p = EQ (window, emacsframe->tab_bar_window);
if (tab_bar_p)
NSTRACE_MSG ("mouse_autoselect_window");
static Lisp_Object last_mouse_window;
Lisp_Object window
- = window_from_coordinates (emacsframe, pt.x, pt.y, 0, 0, 0);
+ = window_from_coordinates (emacsframe, pt.x, pt.y, 0, 0, 0, 0);
if (WINDOWP (window)
&& !EQ (window, last_mouse_window)
{
static Lisp_Object last_mouse_window;
Lisp_Object window = window_from_coordinates
- (f, event->motion.x, event->motion.y, 0, false, false);
+ (f, event->motion.x, event->motion.y, 0, false, false, false);
/* A window will be autoselected only when it is not
selected now and the last mouse movement event was
int x = event->button.x;
int y = event->button.y;
- window = window_from_coordinates (f, x, y, 0, true, true);
+ window = window_from_coordinates (f, x, y, 0, true, true, true);
tab_bar_p = EQ (window, f->tab_bar_window);
if (tab_bar_p)
if (!NILP (Vmouse_autoselect_window))
{
Lisp_Object mouse_window = window_from_coordinates (f, mx, my,
- 0, 0, 0);
+ 0, 0, 0, 0);
/* A window will be selected only when it is not
selected now, and the last mouse movement event was
not in it. A minibuffer window will be selected iff
if (w32_wheel_scroll_lines == UINT_MAX)
{
Lisp_Object window = window_from_coordinates (f, p.x, p.y, NULL,
- false, false);
+ false, false, false);
if (!WINDOWP (window))
{
result->kind = NO_EVENT;
{
static Lisp_Object last_mouse_window;
Lisp_Object window = window_from_coordinates
- (f, LOWORD (msg.msg.lParam), HIWORD (msg.msg.lParam), 0, 0, 0);
+ (f, LOWORD (msg.msg.lParam), HIWORD (msg.msg.lParam), 0, 0, 0, 0);
/* Window will be selected only when it is not
selected now and last mouse movement event was
int x = XFIXNAT (inev.x);
int y = XFIXNAT (inev.y);
- window = window_from_coordinates (f, x, y, 0, 1, 1);
+ window = window_from_coordinates (f, x, y, 0, 1, 1, 1);
if (EQ (window, f->tab_bar_window))
{
int x = XFIXNAT (inev.x);
int y = XFIXNAT (inev.y);
- window = window_from_coordinates (f, x, y, 0, 1, 1);
+ window = window_from_coordinates (f, x, y, 0, 1, 1, 1);
if (EQ (window, f->tool_bar_window)
/* Make sure the tool bar was previously
Lisp_Object
window_from_coordinates (struct frame *f, int x, int y,
- enum window_part *part, bool tab_bar_p, bool tool_bar_p)
+ enum window_part *part, bool menu_bar_p,
+ bool tab_bar_p, bool tool_bar_p)
{
Lisp_Object window;
struct check_window_data cw;
cw.window = &window, cw.x = x, cw.y = y; cw.part = part;
foreach_window (f, check_window_containing, &cw);
+#if defined (HAVE_WINDOW_SYSTEM) && ! defined (HAVE_EXT_MENU_BAR)
+ /* If not found above, see if it's in the menu bar window, if a menu
+ bar exists. */
+ if (NILP (window)
+ && menu_bar_p
+ && WINDOWP (f->menu_bar_window)
+ && WINDOW_TOTAL_LINES (XWINDOW (f->menu_bar_window)) > 0
+ && (coordinates_in_window (XWINDOW (f->menu_bar_window), x, y)
+ != ON_NOTHING))
+ {
+ *part = ON_TEXT;
+ window = f->menu_bar_window;
+ }
+#endif
+
#if defined (HAVE_WINDOW_SYSTEM)
/* If not found above, see if it's in the tab bar window, if a tab
bar exists. */
+ FRAME_INTERNAL_BORDER_WIDTH (f)),
(FRAME_PIXEL_Y_FROM_CANON_Y (f, y)
+ FRAME_INTERNAL_BORDER_WIDTH (f)),
- 0, false, false);
+ 0, false, false, false);
}
ptrdiff_t
extern Lisp_Object make_window (void);
extern Lisp_Object window_from_coordinates (struct frame *, int, int,
- enum window_part *, bool, bool);
+ enum window_part *, bool, bool, bool);
extern void resize_frame_windows (struct frame *, int, bool);
extern void restore_window_configuration (Lisp_Object);
extern void delete_all_child_windows (Lisp_Object);
goto virtual_glyph;
}
else if (!f->glyphs_initialized_p
- || (window = window_from_coordinates (f, gx, gy, &part, false, false),
+ || (window = window_from_coordinates (f, gx, gy, &part, false, false, false),
NILP (window)))
{
width = FRAME_SMALLEST_CHAR_WIDTH (f);
return;
/* Which window is that in? */
- window = window_from_coordinates (f, x, y, &part, true, true);
+ window = window_from_coordinates (f, x, y, &part, true, true, true);
/* If displaying active text in another window, clear that. */
if (! EQ (window, hlinfo->mouse_face_window)
}
Lisp_Object window = window_from_coordinates
- (f, xmotion.x, xmotion.y, 0, false, false);
+ (f, xmotion.x, xmotion.y, 0, false, false, false);
/* A window will be autoselected only when it is not
selected now and the last mouse movement event was
int x = event->xbutton.x;
int y = event->xbutton.y;
- window = window_from_coordinates (f, x, y, 0, true, true);
+ window = window_from_coordinates (f, x, y, 0, true, true, true);
tab_bar_p = EQ (window, f->tab_bar_window);
if (tab_bar_p)
int x = event->xbutton.x;
int y = event->xbutton.y;
- window = window_from_coordinates (f, x, y, 0, true, true);
+ window = window_from_coordinates (f, x, y, 0, true, true, true);
tool_bar_p = (EQ (window, f->tool_bar_window)
&& (event->xbutton.type != ButtonRelease
|| f->last_tool_bar_item != -1));
continue;
window = window_from_coordinates (f, real_x, real_y, NULL,
- false, false);
+ false, false, false);
if (WINDOWP (window))
scroll_height = XWINDOW (window)->pixel_height;
|| !NILP (focus_follows_mouse)))
{
static Lisp_Object last_mouse_window;
- Lisp_Object window = window_from_coordinates (f, ev.x, ev.y, 0, false, false);
+ Lisp_Object window = window_from_coordinates (f, ev.x, ev.y, 0, false, false,
+ false);
/* A window will be autoselected only when it is not
selected now and the last mouse movement event was
int x = bv.x;
int y = bv.y;
- window = window_from_coordinates (f, x, y, 0, true, true);
+ window = window_from_coordinates (f, x, y, 0, true, true, true);
tab_bar_p = EQ (window, f->tab_bar_window);
if (tab_bar_p)
int x = bv.x;
int y = bv.y;
- window = window_from_coordinates (f, x, y, 0, true, true);
+ window = window_from_coordinates (f, x, y, 0, true, true, true);
/* Ignore button release events if the mouse
wasn't previously pressed on the tool bar.
We do this because otherwise selecting some
int x = xev->event_x;
int y = xev->event_y;
- window = window_from_coordinates (f, x, y, 0, true, true);
+ window = window_from_coordinates (f, x, y, 0, true, true, true);
/* Ignore button release events if the mouse
wasn't previously pressed on the tool bar.
We do this because otherwise selecting some