Commit da562f4d authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Add a direction-changed signal, and gdk_keymap_get_current_direction().

Fri Jun  8 12:03:07 2001  Owen Taylor  <otaylor@redhat.com>

	* gdk/gdkkeys.[ch]: Add a direction-changed signal,
	and gdk_keymap_get_current_direction().

	* gdk/x11/gdkevents-x11.c gdk/x11/gdkkeys-x11.c
	  gdk/x11/gdkmain-x11.c gdk/x11/gdkprivate-x11.h: Track
	the current locked group, use it to set the keymap
	direction.

	* gtk/gtksettings.c: Add a new gtk-split-cursor setting
	to determine whether we draw a split cursor or use
	a jumping cursor based on the current direction.

	* gtk/gtkentry.c gtk/gtktextview.c gtk/gtktextlayout.[ch]:
	Obey the split cursor setting.

Fri Jun  8 11:57:50 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkimmulticontext.c (activate_cb): Only activate
	when toggling on, not when toggling off... (#55906)

Wed Jun  6 10:37:07 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c (gtk_widget_set_double_buffered):
	s/gdk_window_begin_paint/gdk_window_begin_paint_region/
	in docs. (#55812, Vitaly Tishkov)
parent 11699349
Fri Jun 8 12:03:07 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkkeys.[ch]: Add a direction-changed signal,
and gdk_keymap_get_current_direction().
* gdk/x11/gdkevents-x11.c gdk/x11/gdkkeys-x11.c
gdk/x11/gdkmain-x11.c gdk/x11/gdkprivate-x11.h: Track
the current locked group, use it to set the keymap
direction.
* gtk/gtksettings.c: Add a new gtk-split-cursor setting
to determine whether we draw a split cursor or use
a jumping cursor based on the current direction.
* gtk/gtkentry.c gtk/gtktextview.c gtk/gtktextlayout.[ch]:
Obey the split cursor setting.
Fri Jun 8 11:57:50 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c (activate_cb): Only activate
when toggling on, not when toggling off... (#55906)
Wed Jun 6 10:37:07 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_double_buffered):
s/gdk_window_begin_paint/gdk_window_begin_paint_region/
in docs. (#55812, Vitaly Tishkov)
2001-06-08 Anders Carlsson <andersca@codefactory.se>
* demos/gtk-demo/main.c (create_tree): Changed signal name from
......
Fri Jun 8 12:03:07 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkkeys.[ch]: Add a direction-changed signal,
and gdk_keymap_get_current_direction().
* gdk/x11/gdkevents-x11.c gdk/x11/gdkkeys-x11.c
gdk/x11/gdkmain-x11.c gdk/x11/gdkprivate-x11.h: Track
the current locked group, use it to set the keymap
direction.
* gtk/gtksettings.c: Add a new gtk-split-cursor setting
to determine whether we draw a split cursor or use
a jumping cursor based on the current direction.
* gtk/gtkentry.c gtk/gtktextview.c gtk/gtktextlayout.[ch]:
Obey the split cursor setting.
Fri Jun 8 11:57:50 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c (activate_cb): Only activate
when toggling on, not when toggling off... (#55906)
Wed Jun 6 10:37:07 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_double_buffered):
s/gdk_window_begin_paint/gdk_window_begin_paint_region/
in docs. (#55812, Vitaly Tishkov)
2001-06-08 Anders Carlsson <andersca@codefactory.se>
* demos/gtk-demo/main.c (create_tree): Changed signal name from
......
Fri Jun 8 12:03:07 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkkeys.[ch]: Add a direction-changed signal,
and gdk_keymap_get_current_direction().
* gdk/x11/gdkevents-x11.c gdk/x11/gdkkeys-x11.c
gdk/x11/gdkmain-x11.c gdk/x11/gdkprivate-x11.h: Track
the current locked group, use it to set the keymap
direction.
* gtk/gtksettings.c: Add a new gtk-split-cursor setting
to determine whether we draw a split cursor or use
a jumping cursor based on the current direction.
* gtk/gtkentry.c gtk/gtktextview.c gtk/gtktextlayout.[ch]:
Obey the split cursor setting.
Fri Jun 8 11:57:50 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c (activate_cb): Only activate
when toggling on, not when toggling off... (#55906)
Wed Jun 6 10:37:07 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_double_buffered):
s/gdk_window_begin_paint/gdk_window_begin_paint_region/
in docs. (#55812, Vitaly Tishkov)
2001-06-08 Anders Carlsson <andersca@codefactory.se>
* demos/gtk-demo/main.c (create_tree): Changed signal name from
......
Fri Jun 8 12:03:07 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkkeys.[ch]: Add a direction-changed signal,
and gdk_keymap_get_current_direction().
* gdk/x11/gdkevents-x11.c gdk/x11/gdkkeys-x11.c
gdk/x11/gdkmain-x11.c gdk/x11/gdkprivate-x11.h: Track
the current locked group, use it to set the keymap
direction.
* gtk/gtksettings.c: Add a new gtk-split-cursor setting
to determine whether we draw a split cursor or use
a jumping cursor based on the current direction.
* gtk/gtkentry.c gtk/gtktextview.c gtk/gtktextlayout.[ch]:
Obey the split cursor setting.
Fri Jun 8 11:57:50 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c (activate_cb): Only activate
when toggling on, not when toggling off... (#55906)
Wed Jun 6 10:37:07 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_double_buffered):
s/gdk_window_begin_paint/gdk_window_begin_paint_region/
in docs. (#55812, Vitaly Tishkov)
2001-06-08 Anders Carlsson <andersca@codefactory.se>
* demos/gtk-demo/main.c (create_tree): Changed signal name from
......
Fri Jun 8 12:03:07 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkkeys.[ch]: Add a direction-changed signal,
and gdk_keymap_get_current_direction().
* gdk/x11/gdkevents-x11.c gdk/x11/gdkkeys-x11.c
gdk/x11/gdkmain-x11.c gdk/x11/gdkprivate-x11.h: Track
the current locked group, use it to set the keymap
direction.
* gtk/gtksettings.c: Add a new gtk-split-cursor setting
to determine whether we draw a split cursor or use
a jumping cursor based on the current direction.
* gtk/gtkentry.c gtk/gtktextview.c gtk/gtktextlayout.[ch]:
Obey the split cursor setting.
Fri Jun 8 11:57:50 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c (activate_cb): Only activate
when toggling on, not when toggling off... (#55906)
Wed Jun 6 10:37:07 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_double_buffered):
s/gdk_window_begin_paint/gdk_window_begin_paint_region/
in docs. (#55812, Vitaly Tishkov)
2001-06-08 Anders Carlsson <andersca@codefactory.se>
* demos/gtk-demo/main.c (create_tree): Changed signal name from
......
Fri Jun 8 12:03:07 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkkeys.[ch]: Add a direction-changed signal,
and gdk_keymap_get_current_direction().
* gdk/x11/gdkevents-x11.c gdk/x11/gdkkeys-x11.c
gdk/x11/gdkmain-x11.c gdk/x11/gdkprivate-x11.h: Track
the current locked group, use it to set the keymap
direction.
* gtk/gtksettings.c: Add a new gtk-split-cursor setting
to determine whether we draw a split cursor or use
a jumping cursor based on the current direction.
* gtk/gtkentry.c gtk/gtktextview.c gtk/gtktextlayout.[ch]:
Obey the split cursor setting.
Fri Jun 8 11:57:50 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c (activate_cb): Only activate
when toggling on, not when toggling off... (#55906)
Wed Jun 6 10:37:07 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_double_buffered):
s/gdk_window_begin_paint/gdk_window_begin_paint_region/
in docs. (#55812, Vitaly Tishkov)
2001-06-08 Anders Carlsson <andersca@codefactory.se>
* demos/gtk-demo/main.c (create_tree): Changed signal name from
......
Fri Jun 8 12:03:07 2001 Owen Taylor <otaylor@redhat.com>
* gdk/gdkkeys.[ch]: Add a direction-changed signal,
and gdk_keymap_get_current_direction().
* gdk/x11/gdkevents-x11.c gdk/x11/gdkkeys-x11.c
gdk/x11/gdkmain-x11.c gdk/x11/gdkprivate-x11.h: Track
the current locked group, use it to set the keymap
direction.
* gtk/gtksettings.c: Add a new gtk-split-cursor setting
to determine whether we draw a split cursor or use
a jumping cursor based on the current direction.
* gtk/gtkentry.c gtk/gtktextview.c gtk/gtktextlayout.[ch]:
Obey the split cursor setting.
Fri Jun 8 11:57:50 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkimmulticontext.c (activate_cb): Only activate
when toggling on, not when toggling off... (#55906)
Wed Jun 6 10:37:07 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_double_buffered):
s/gdk_window_begin_paint/gdk_window_begin_paint_region/
in docs. (#55812, Vitaly Tishkov)
2001-06-08 Anders Carlsson <andersca@codefactory.se>
* demos/gtk-demo/main.c (create_tree): Changed signal name from
......
......@@ -495,7 +495,6 @@ This can later be composited together with other
#GtkRcStyle structures to form a #GtkStyle.
</para>
@parent_instance:
@name:
@bg_pixmap_name:
@font_desc:
......
......@@ -27,12 +27,19 @@
#include "gdkkeys.h"
#include <config.h>
enum {
DIRECTION_CHANGED,
LAST_SIGNAL
};
static void gdk_keymap_init (GdkKeymap *keymap);
static void gdk_keymap_class_init (GdkKeymapClass *klass);
static void gdk_keymap_finalize (GObject *object);
static gpointer parent_class = NULL;
static guint signals[LAST_SIGNAL] = { 0 };
GType
gdk_keymap_get_type (void)
{
......@@ -75,6 +82,16 @@ gdk_keymap_class_init (GdkKeymapClass *klass)
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gdk_keymap_finalize;
signals[DIRECTION_CHANGED] =
g_signal_newc ("direction_changed",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GdkKeymapClass, direction_changed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
}
static void
......@@ -85,17 +102,6 @@ gdk_keymap_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
GdkKeymap*
gdk_keymap_get_default (void)
{
static GdkKeymap *keymap = NULL;
if (keymap == NULL)
keymap = g_object_new (gdk_keymap_get_type (), NULL);
return keymap;
}
/* Other key-handling stuff
......
......@@ -70,6 +70,8 @@ struct _GdkKeymap
struct _GdkKeymapClass
{
GObjectClass parent_class;
void (*direction_changed) (void);
};
GType gdk_keymap_get_type (void) G_GNUC_CONST;
......@@ -77,25 +79,26 @@ GType gdk_keymap_get_type (void) G_GNUC_CONST;
GdkKeymap* gdk_keymap_get_default (void);
guint gdk_keymap_lookup_key (GdkKeymap *keymap,
const GdkKeymapKey *key);
gboolean gdk_keymap_translate_keyboard_state (GdkKeymap *keymap,
guint hardware_keycode,
GdkModifierType state,
gint group,
guint *keyval,
gint *effective_group,
gint *level,
GdkModifierType *unused_modifiers);
gboolean gdk_keymap_get_entries_for_keyval (GdkKeymap *keymap,
guint keyval,
GdkKeymapKey **keys,
gint *n_keys);
gboolean gdk_keymap_get_entries_for_keycode (GdkKeymap *keymap,
guint hardware_keycode,
GdkKeymapKey **keys,
guint **keyvals,
gint *n_entries);
guint gdk_keymap_lookup_key (GdkKeymap *keymap,
const GdkKeymapKey *key);
gboolean gdk_keymap_translate_keyboard_state (GdkKeymap *keymap,
guint hardware_keycode,
GdkModifierType state,
gint group,
guint *keyval,
gint *effective_group,
gint *level,
GdkModifierType *unused_modifiers);
gboolean gdk_keymap_get_entries_for_keyval (GdkKeymap *keymap,
guint keyval,
GdkKeymapKey **keys,
gint *n_keys);
gboolean gdk_keymap_get_entries_for_keycode (GdkKeymap *keymap,
guint hardware_keycode,
GdkKeymapKey **keys,
guint **keyvals,
gint *n_entries);
PangoDirection gdk_keymap_get_direction (GdkKeymap *keymap);
/* Key values
*/
......
......@@ -1428,24 +1428,38 @@ gdk_event_translate (GdkEvent *event,
return_val = FALSE;
break;
#ifdef HAVE_XKB
case XkbMapNotify:
++_gdk_keymap_serial;
return_val = FALSE;
break;
#endif
default:
/* something else - (e.g., a Xinput event) */
if (window_private &&
!GDK_WINDOW_DESTROYED (window_private) &&
(window_private->extension_events != 0))
return_val = _gdk_input_other_event(event, xevent, window);
#ifdef HAVE_XKB
if (xevent->type == _gdk_xkb_event_type)
{
XkbEvent *xkb_event = (XkbEvent *)xevent;
switch (xkb_event->any.xkb_type)
{
case XkbMapNotify:
++_gdk_keymap_serial;
return_val = FALSE;
break;
case XkbStateNotify:
_gdk_keymap_state_changed ();
break;
}
}
else
return_val = FALSE;
break;
#endif
{
/* something else - (e.g., a Xinput event) */
if (window_private &&
!GDK_WINDOW_DESTROYED (window_private) &&
(window_private->extension_events != 0))
return_val = _gdk_input_other_event(event, xevent, window);
else
return_val = FALSE;
break;
}
}
done:
......
......@@ -56,6 +56,7 @@ update_keyrange (void)
#include <X11/XKBlib.h>
gboolean _gdk_use_xkb = FALSE;
gint _gdk_xkb_event_type;
static XkbDescPtr xkb_desc = NULL;
static XkbDescPtr
......@@ -70,10 +71,13 @@ get_xkb (void)
xkb_desc = XkbGetMap (gdk_display, XkbKeySymsMask, XkbUseCoreKbd);
if (xkb_desc == NULL)
g_error ("Failed to get keymap");
XkbGetNames (gdk_display, XkbGroupNamesMask, xkb_desc);
}
else if (current_serial != _gdk_keymap_serial)
{
XkbGetUpdatedMap (gdk_display, XkbKeySymsMask, xkb_desc);
XkbGetNames (gdk_display, XkbGroupNamesMask, xkb_desc);
}
current_serial = _gdk_keymap_serial;
......@@ -92,6 +96,18 @@ static KeySym* keymap = NULL;
static gint keysyms_per_keycode = 0;
static XModifierKeymap* mod_keymap = NULL;
static GdkModifierType group_switch_mask = 0;
static PangoDirection current_direction;
static gboolean have_direction = FALSE;
static GdkKeymap *default_keymap = NULL;
GdkKeymap*
gdk_keymap_get_default (void)
{
if (default_keymap == NULL)
default_keymap = g_object_new (gdk_keymap_get_type (), NULL);
return default_keymap;
}
static void
update_keymaps (void)
......@@ -175,6 +191,60 @@ get_keymap (void)
return keymap;
}
#if HAVE_XKB
PangoDirection
get_direction (void)
{
XkbDescRec *xkb = get_xkb ();
char *name;
XkbStateRec state_rec;
PangoDirection result;
XkbGetState (gdk_display, XkbUseCoreKbd, &state_rec);
name = gdk_atom_name (xkb->names->groups[state_rec.locked_group]);
if (g_strcasecmp (name, "arabic") == 0 ||
g_strcasecmp (name, "hebrew") == 0 ||
g_strcasecmp (name, "israelian") == 0)
result = PANGO_DIRECTION_RTL;
else
result = PANGO_DIRECTION_LTR;
g_free (name);
return result;
}
void
_gdk_keymap_state_changed (void)
{
if (default_keymap)
{
PangoDirection new_direction = get_direction ();
if (!have_direction || new_direction != current_direction)
{
have_direction = TRUE;
current_direction = new_direction;
g_signal_emit_by_name (G_OBJECT (default_keymap), "direction_changed");
}
}
}
#endif /* HAVE_XKB */
PangoDirection
gdk_keymap_get_direction (GdkKeymap *keymap)
{
if (!have_direction)
{
current_direction = get_direction ();
have_direction = TRUE;
}
return current_direction;
}
/**
* gdk_keymap_get_entries_for_keyval:
* @keymap: a #GdkKeymap, or %NULL to use the default keymap
......
......@@ -170,21 +170,23 @@ _gdk_windowing_init_check (int argc, char **argv)
{
gint xkb_major = XkbMajorVersion;
gint xkb_minor = XkbMinorVersion;
gint xkb_event_type;
if (XkbLibraryVersion (&xkb_major, &xkb_minor))
{
xkb_major = XkbMajorVersion;
xkb_minor = XkbMinorVersion;
if (XkbQueryExtension (gdk_display, NULL, NULL, NULL,
if (XkbQueryExtension (gdk_display, NULL, &_gdk_xkb_event_type, NULL,
&xkb_major, &xkb_minor))
{
Bool detectable_autorepeat_supported;
_gdk_use_xkb = TRUE;
XkbSelectEvents (gdk_display,
XkbUseCoreKbd,
XkbMapNotifyMask,
XkbMapNotifyMask);
XkbMapNotifyMask | XkbStateNotifyMask,
XkbMapNotifyMask | XkbStateNotifyMask);
XkbSetDetectableAutoRepeat (gdk_display,
True,
......
......@@ -95,6 +95,8 @@ void _gdk_region_get_xrectangles (GdkRegion *region,
void _gdk_moveresize_handle_event (XEvent *event);
void _gdk_moveresize_configure_done (void);
void _gdk_keymap_state_changed (void);
extern GdkDrawableClass _gdk_x11_drawable_class;
extern gboolean gdk_use_xshm;
extern Atom gdk_wm_delete_window;
......@@ -115,6 +117,7 @@ extern guint _gdk_keymap_serial;
#ifdef HAVE_XKB
extern gboolean _gdk_use_xkb;
extern gboolean _gdk_have_xkb_autorepeat;
extern gint _gdk_xkb_event_type;
#endif
/* Whether we were able to turn on detectable-autorepeat using
......
......@@ -211,6 +211,8 @@ static void gtk_entry_toggle_overwrite (GtkEntry *entry);
static void gtk_entry_real_activate (GtkEntry *entry);
static void gtk_entry_popup_menu (GtkWidget *widget);
static void gtk_entry_keymap_direction_changed (GdkKeymap *keymap,
GtkEntry *entry);
/* IM Context Callbacks
*/
static void gtk_entry_commit_cb (GtkIMContext *context,
......@@ -1511,6 +1513,11 @@ gtk_entry_focus_in (GtkWidget *widget,
entry->need_im_reset = TRUE;
gtk_im_context_focus_in (entry->im_context);
g_signal_connect_data (gdk_keymap_get_default (),
"direction_changed",
G_CALLBACK (gtk_entry_keymap_direction_changed), entry, NULL,
FALSE, FALSE);
gtk_entry_check_cursor_blink (entry);
return FALSE;
......@@ -1530,6 +1537,10 @@ gtk_entry_focus_out (GtkWidget *widget,
gtk_entry_check_cursor_blink (entry);
g_signal_disconnect_by_func (gdk_keymap_get_default (),
gtk_entry_keymap_direction_changed,
entry);
return FALSE;
}
......@@ -2006,6 +2017,13 @@ gtk_entry_real_activate (GtkEntry *entry)
}
}
static void
gtk_entry_keymap_direction_changed (GdkKeymap *keymap,
GtkEntry *entry)
{
gtk_entry_queue_draw (entry);
}
/* IM Context Callbacks
*/
......@@ -2408,29 +2426,64 @@ static void
gtk_entry_draw_cursor (GtkEntry *entry,
CursorType type)
{
GtkTextDirection keymap_direction =
(gdk_keymap_get_direction (gdk_keymap_get_default ()) == PANGO_DIRECTION_LTR) ?
GTK_TEXT_DIR_LTR : GTK_TEXT_DIR_RTL;
GtkTextDirection widget_direction = gtk_widget_get_direction (GTK_WIDGET (entry));
g_return_if_fail (entry != NULL);
g_return_if_fail (GTK_IS_ENTRY (entry));
if (GTK_WIDGET_DRAWABLE (entry))
{
GtkWidget *widget = GTK_WIDGET (entry);
gboolean split_cursor;
gint xoffset = INNER_BORDER - entry->scroll_offset;
gint strong_x, weak_x;
gint text_area_height;
GdkGC *gc1 = NULL;
GdkGC *gc2 = NULL;
gint x1 = 0;
gint x2 = 0;
gdk_window_get_size (entry->text_area, NULL, &text_area_height);
gtk_entry_get_cursor_locations (entry, type, &strong_x, &weak_x);
g_object_get (gtk_settings_get_global (),
"gtk-split-cursor", &split_cursor,
NULL);
if (split_cursor)
{
gc1 = entry->cursor_gc;
x1 = strong_x;
if (weak_x != strong_x)
{
gc2 = widget->style->text_gc[GTK_STATE_NORMAL];
x2 = weak_x;
}
}
else
{
gc1 = entry->cursor_gc;
if (keymap_direction == widget_direction)
x1 = strong_x;
else
x1 = weak_x;
}
gdk_draw_line (entry->text_area, entry->cursor_gc,
xoffset + strong_x, INNER_BORDER,
xoffset + strong_x, text_area_height - INNER_BORDER);
gdk_draw_line (entry->text_area, gc1,
xoffset + x1, INNER_BORDER,
xoffset + x1, text_area_height - INNER_BORDER);
if (weak_x != strong_x)
gdk_draw_line (entry->text_area, widget->style->text_gc[GTK_STATE_NORMAL],
xoffset + weak_x, INNER_BORDER,
xoffset + weak_x, text_area_height - INNER_BORDER);
if (gc2)
gdk_draw_line (entry->text_area, gc2,
xoffset + x2, INNER_BORDER,
xoffset + x2, text_area_height - INNER_BORDER);
}
}
......@@ -2624,15 +2677,32 @@ gtk_entry_move_visually (GtkEntry *entry,
while (count != 0)
{
int new_index, new_trailing;
gboolean split_cursor;
gboolean strong;
g_object_get (gtk_settings_get_global (),
"gtk-split-cursor", &split_cursor,
NULL);
if (split_cursor)
strong = TRUE;
else
{
GtkTextDirection keymap_direction =
(gdk_keymap_get_direction (gdk_keymap_get_default ()) == PANGO_DIRECTION_LTR) ?
GTK_TEXT_DIR_LTR : GTK_TEXT_DIR_RTL;
strong = keymap_direction == gtk_widget_get_direction (GTK_WIDGET (entry));
}
if (count > 0)
{
pango_layout_move_cursor_visually (layout, index, 0, 1, &new_index, &new_trailing);
pango_layout_move_cursor_visually (layout, strong, index, 0, 1, &new_index, &new_trailing);
count--;
}
else
{
pango_layout_move_cursor_visually (layout, index, 0, -1, &new_index, &new_trailing);
pango_layout_move_cursor_visually (layout, strong, index, 0, -1, &new_index, &new_trailing);
count++;
}
......@@ -3630,5 +3700,3 @@ gtk_entry_pend_cursor_blink (GtkEntry *entry)
show_cursor (entry);
}
}
......@@ -313,12 +313,15 @@ static void
activate_cb (GtkWidget *menuitem,
GtkIMMulticontext *context)
{
const gchar *id = gtk_object_get_data (GTK_OBJECT (menuitem), "gtk-context-id");
gtk_im_context_reset (GTK_IM_CONTEXT (context));
if (GTK_CHECK_MENU_ITEM (menuitem)->active)
{
const gchar *id = gtk_object_get_data (GTK_OBJECT (menuitem), "gtk-context-id");
global_context_id = id;
gtk_im_multicontext_set_slave (context, NULL);
gtk_im_context_reset (GTK_IM_CONTEXT (context));
global_context_id = id;
gtk_im_multicontext_set_slave (context, NULL);
}
}
/**
......
......@@ -24,6 +24,7 @@ enum {
PROP_DOUBLE_CLICK_TIME,
PROP_CURSOR_BLINK,
PROP_CURSOR_BLINK_TIME,
PROP_SPLIT_CURSOR
};
......@@ -151,6 +152,14 @@ gtk_settings_class_init (GtkSettingsClass *class)
G_PARAM_READWRITE),
NULL);
g_assert (result == PROP_CURSOR_BLINK_TIME);
result = settings_install_property_parser (class,
g_param_spec_boolean ("gtk-split-cursor",
_("Split Cursor"),
_("Whether two cursors should be displayed for mixed left-to-right and right-to-left text"),
TRUE,
G_PARAM_READWRITE),
NULL);
g_assert (result == PROP_SPLIT_CURSOR);
}
static void
......
......@@ -409,13 +409,13 @@ _gtk_text_btree_new (GtkTextTagTable *table,
tree->tag_changed_handler = g_signal_connect_data (G_OBJECT (tree->table),
"tag_changed",
tag_changed_cb,
G_CALLBACK (tag_changed_cb),
tree,
NULL, FALSE, FALSE);
tree->tag_removed_handler = g_signal_connect_data (G_OBJECT (tree->table),