Fix for #84668, reported by Torbjrn Andersson:

2003-06-05  Matthias Clasen  <maclas@gmx.de>

	* gtk/gtktextview.c: Fix for #84668, reported by Torbjrn Andersson:
	(gtk_text_view_grab_notify):
	(gtk_text_view_state_changed): Implement these
	to unobscure cursor when grab shadowed or insensitised.
	(gtk_text_view_unobscure_mouse_cursor): New function to undo the
	effect of gtk_text_view_obscure_mouse_cursor(). Code lifted from
	gtk_text_view_motion_event().
	(gtk_text_view_motion_event): Use gtk_text_view_obscure_mouse_cursor().
This commit is contained in:
Matthias Clasen 2003-06-05 19:34:03 +00:00 committed by Matthias Clasen
parent 4c7356281f
commit fc82265675
6 changed files with 73 additions and 10 deletions

View File

@ -1,5 +1,14 @@
2003-06-05 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextview.c: Fix for #84668, reported by Torbjörn Andersson:
(gtk_text_view_grab_notify):
(gtk_text_view_state_changed): Implement these
to unobscure cursor when grab shadowed or insensitised.
(gtk_text_view_unobscure_mouse_cursor): New function to undo the
effect of gtk_text_view_obscure_mouse_cursor(). Code lifted from
gtk_text_view_motion_event().
(gtk_text_view_motion_event): Use gtk_text_view_obscure_mouse_cursor().
* gtk/gtktextview.c (select_all): New keybinding signal for
(un)selecting the whole buffer. Bound to C-a/C-\. (see #107889)

View File

@ -1,5 +1,14 @@
2003-06-05 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextview.c: Fix for #84668, reported by Torbjörn Andersson:
(gtk_text_view_grab_notify):
(gtk_text_view_state_changed): Implement these
to unobscure cursor when grab shadowed or insensitised.
(gtk_text_view_unobscure_mouse_cursor): New function to undo the
effect of gtk_text_view_obscure_mouse_cursor(). Code lifted from
gtk_text_view_motion_event().
(gtk_text_view_motion_event): Use gtk_text_view_obscure_mouse_cursor().
* gtk/gtktextview.c (select_all): New keybinding signal for
(un)selecting the whole buffer. Bound to C-a/C-\. (see #107889)

View File

@ -1,5 +1,14 @@
2003-06-05 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextview.c: Fix for #84668, reported by Torbjörn Andersson:
(gtk_text_view_grab_notify):
(gtk_text_view_state_changed): Implement these
to unobscure cursor when grab shadowed or insensitised.
(gtk_text_view_unobscure_mouse_cursor): New function to undo the
effect of gtk_text_view_obscure_mouse_cursor(). Code lifted from
gtk_text_view_motion_event().
(gtk_text_view_motion_event): Use gtk_text_view_obscure_mouse_cursor().
* gtk/gtktextview.c (select_all): New keybinding signal for
(un)selecting the whole buffer. Bound to C-a/C-\. (see #107889)

View File

@ -1,5 +1,14 @@
2003-06-05 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextview.c: Fix for #84668, reported by Torbjörn Andersson:
(gtk_text_view_grab_notify):
(gtk_text_view_state_changed): Implement these
to unobscure cursor when grab shadowed or insensitised.
(gtk_text_view_unobscure_mouse_cursor): New function to undo the
effect of gtk_text_view_obscure_mouse_cursor(). Code lifted from
gtk_text_view_motion_event().
(gtk_text_view_motion_event): Use gtk_text_view_obscure_mouse_cursor().
* gtk/gtktextview.c (select_all): New keybinding signal for
(un)selecting the whole buffer. Bound to C-a/C-\. (see #107889)

View File

@ -1,5 +1,14 @@
2003-06-05 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextview.c: Fix for #84668, reported by Torbjörn Andersson:
(gtk_text_view_grab_notify):
(gtk_text_view_state_changed): Implement these
to unobscure cursor when grab shadowed or insensitised.
(gtk_text_view_unobscure_mouse_cursor): New function to undo the
effect of gtk_text_view_obscure_mouse_cursor(). Code lifted from
gtk_text_view_motion_event().
(gtk_text_view_motion_event): Use gtk_text_view_obscure_mouse_cursor().
* gtk/gtktextview.c (select_all): New keybinding signal for
(un)selecting the whole buffer. Bound to C-a/C-\. (see #107889)

View File

@ -161,6 +161,8 @@ static void gtk_text_view_style_set (GtkWidget *widget,
GtkStyle *previous_style);
static void gtk_text_view_direction_changed (GtkWidget *widget,
GtkTextDirection previous_direction);
static void gtk_text_view_grab_notify (GtkWidget *widget,
gboolean was_grabbed);
static void gtk_text_view_state_changed (GtkWidget *widget,
GtkStateType previous_state);
@ -491,6 +493,7 @@ gtk_text_view_class_init (GtkTextViewClass *klass)
widget_class->unrealize = gtk_text_view_unrealize;
widget_class->style_set = gtk_text_view_style_set;
widget_class->direction_changed = gtk_text_view_direction_changed;
widget_class->grab_notify = gtk_text_view_grab_notify;
widget_class->state_changed = gtk_text_view_state_changed;
widget_class->size_request = gtk_text_view_size_request;
widget_class->size_allocate = gtk_text_view_size_allocate;
@ -3555,6 +3558,30 @@ gtk_text_view_obscure_mouse_cursor (GtkTextView *text_view)
text_view->mouse_cursor_obscured = TRUE;
}
static void
gtk_text_view_unobscure_mouse_cursor (GtkTextView *text_view)
{
if (text_view->mouse_cursor_obscured)
{
GdkCursor *cursor;
cursor = gdk_cursor_new_for_display (gtk_widget_get_display (GTK_WIDGET (text_view)),
GDK_XTERM);
gdk_window_set_cursor (text_view->text_window->bin_window, cursor);
gdk_cursor_unref (cursor);
text_view->mouse_cursor_obscured = FALSE;
}
}
static void
gtk_text_view_grab_notify (GtkWidget *widget,
gboolean was_grabbed)
{
if (!was_grabbed)
gtk_text_view_unobscure_mouse_cursor (GTK_TEXT_VIEW (widget));
}
/*
* Events
*/
@ -3986,16 +4013,7 @@ gtk_text_view_motion_event (GtkWidget *widget, GdkEventMotion *event)
{
GtkTextView *text_view = GTK_TEXT_VIEW (widget);
if (text_view->mouse_cursor_obscured)
{
GdkCursor *cursor;
cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget),
GDK_XTERM);
gdk_window_set_cursor (text_view->text_window->bin_window, cursor);
gdk_cursor_unref (cursor);
text_view->mouse_cursor_obscured = FALSE;
}
gtk_text_view_unobscure_mouse_cursor (text_view);
if (event->window == text_view->text_window->bin_window &&
text_view->drag_start_x >= 0)