tags 560573 + fixed-upstream patch
thanks
On 2009-12-11 10:12 +0100, Eugen Dedu wrote:
> Package: emacs23
> Version: 23.1+1-5
> Severity: normal
>
> Starting with debian's 23.1 emacs, when I click on vertical scrollbar
> to page-up or page-down the buffer, the text in the buffer is
> highlighted as if I have clicked in the buffer on the same line as the
> click. More precisely, if the cursor is on letter A and I make click
> on scrollbar near the letter B in the buffer (B is the last character
> of the line), then the text between A and B is selected.
As a workaround, setting GDK_NATIVE_WINDOWS=1 in the environment before
starting Emacs should help.
Here is the patch that got installed upstream¹, which fixes the issue.
I haven't looked whether it applies cleanly on Emacs 23.1, though.
--8<---------------cut here---------------start------------->8---
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 543b868..e95601c 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -3371,38 +3371,6 @@ xg_set_toolkit_scroll_bar_thumb (bar, portion, position,
whole)
}
}
-/* Return non-zero if EVENT is for a scroll bar in frame F.
- When the same X window is used for several Gtk+ widgets, we cannot
- say for sure based on the X window alone if an event is for the
- frame. This function does additional checks.
-
- Return non-zero if the event is for a scroll bar, zero otherwise. */
-
-int
-xg_event_is_for_scrollbar (f, event)
- FRAME_PTR f;
- XEvent *event;
-{
- int retval = 0;
-
- if (f && event->type == ButtonPress)
- {
- /* Check if press occurred outside the edit widget. */
- GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f));
- retval = gdk_display_get_window_at_pointer (gdpy, NULL, NULL)
- != f->output_data.x->edit_widget->window;
- }
- else if (f && (event->type != ButtonRelease || event->type != MotionNotify))
- {
- /* If we are releasing or moving the scroll bar, it has the grab. */
- retval = gtk_grab_get_current () != 0
- && gtk_grab_get_current () != f->output_data.x->edit_widget;
- }
-
- return retval;
-}
-
-
/***********************************************************************
Tool bar functions
diff --git a/src/gtkutil.h b/src/gtkutil.h
index 6d9f6da..faf5395 100644
--- a/src/gtkutil.h
+++ b/src/gtkutil.h
@@ -179,7 +179,7 @@ extern void xg_set_toolkit_scroll_bar_thumb P_ ((struct
scroll_bar *bar,
int portion,
int position,
int whole));
-extern int xg_event_is_for_scrollbar P_ ((FRAME_PTR f, XEvent *event));
+
extern void update_frame_tool_bar P_ ((FRAME_PTR f));
extern void free_frame_tool_bar P_ ((FRAME_PTR f));
diff --git a/src/xterm.c b/src/xterm.c
index 545f3a5..1ba367c 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -6688,10 +6688,6 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
clear_mouse_face (dpyinfo);
}
-#ifdef USE_GTK
- if (f && xg_event_is_for_scrollbar (f, &event))
- f = 0;
-#endif
if (f)
{
@@ -6828,10 +6824,6 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
else
f = x_window_to_frame (dpyinfo, event.xbutton.window);
-#ifdef USE_GTK
- if (f && xg_event_is_for_scrollbar (f, &event))
- f = 0;
-#endif
if (f)
{
/* Is this in the tool-bar? */
--8<---------------cut here---------------end--------------->8---
Cheers,
Sven
¹
http://git.savannah.gnu.org/gitweb/?p=emacs.git;a=commitdiff;h=05caf88f056600a89b434982df4bda33a532b995
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]