Remove non-multihead-safe uses of clipboards and settings. (#504722,

2007-12-24  Matthias Clasen  <mclasen@redhat.com>

        * modules/other/gail/gailentry.c:
        * modules/other/gail/gailimage.c:
        * modules/other/gail/gailtextview.c: Remove non-multihead-safe
        uses of clipboards and settings.  (#504722, Christian Persch)



svn path=/trunk/; revision=19236
This commit is contained in:
Matthias Clasen 2007-12-25 04:52:13 +00:00 committed by Matthias Clasen
parent 0e8282a0a7
commit 99fa9096e0
4 changed files with 37 additions and 8 deletions

View File

@ -1,3 +1,10 @@
2007-12-24 Matthias Clasen <mclasen@redhat.com>
* modules/other/gail/gailentry.c:
* modules/other/gail/gailimage.c:
* modules/other/gail/gailtextview.c: Remove non-multihead-safe
uses of clipboards and settings. (#504722, Christian Persch)
2007-12-24 Matthias Clasen <mclasen@redhat.com>
* gdk/gdkapplaunchcontext.c: Remove unneeded includes. (#505411,

View File

@ -909,6 +909,7 @@ gail_entry_copy_text (AtkEditableText *text,
GtkWidget *widget;
GtkEditable *editable;
gchar *str;
GtkClipboard *clipboard;
widget = GTK_ACCESSIBLE (text)->widget;
if (widget == NULL)
@ -918,7 +919,9 @@ gail_entry_copy_text (AtkEditableText *text,
entry = GTK_ENTRY (widget);
editable = GTK_EDITABLE (entry);
str = gtk_editable_get_chars (editable, start_pos, end_pos);
gtk_clipboard_set_text (gtk_clipboard_get (GDK_NONE), str, -1);
clipboard = gtk_clipboard_get_for_display (gtk_widget_get_display (widget),
GDK_SELECTION_CLIPBOARD);
gtk_clipboard_set_text (clipboard, str, -1);
}
static void
@ -930,6 +933,7 @@ gail_entry_cut_text (AtkEditableText *text,
GtkWidget *widget;
GtkEditable *editable;
gchar *str;
GtkClipboard *clipboard;
widget = GTK_ACCESSIBLE (text)->widget;
if (widget == NULL)
@ -941,7 +945,9 @@ gail_entry_cut_text (AtkEditableText *text,
if (!gtk_editable_get_editable (editable))
return;
str = gtk_editable_get_chars (editable, start_pos, end_pos);
gtk_clipboard_set_text (gtk_clipboard_get (GDK_NONE), str, -1);
clipboard = gtk_clipboard_get_for_display (gtk_widget_get_display (widget),
GDK_SELECTION_CLIPBOARD);
gtk_clipboard_set_text (clipboard, str, -1);
gtk_editable_delete_text (editable, start_pos, end_pos);
}
@ -974,6 +980,7 @@ gail_entry_paste_text (AtkEditableText *text,
GtkWidget *widget;
GtkEditable *editable;
GailEntryPaste paste_struct;
GtkClipboard *clipboard;
widget = GTK_ACCESSIBLE (text)->widget;
if (widget == NULL)
@ -987,7 +994,9 @@ gail_entry_paste_text (AtkEditableText *text,
paste_struct.position = position;
g_object_ref (paste_struct.entry);
gtk_clipboard_request_text (gtk_clipboard_get(GDK_NONE),
clipboard = gtk_clipboard_get_for_display (gtk_widget_get_display (widget),
GDK_SELECTION_CLIPBOARD);
gtk_clipboard_request_text (clipboard,
gail_entry_paste_received, &paste_struct);
}

View File

@ -237,15 +237,19 @@ gail_image_get_image_size (AtkImage *image,
case GTK_IMAGE_STOCK:
{
GtkIconSize size;
GtkSettings *settings;
settings = gtk_settings_get_for_screen (gtk_widget_get_screen (widget));
gtk_image_get_stock(gtk_image, NULL, &size);
gtk_icon_size_lookup(size, width, height);
gtk_icon_size_lookup_for_settings (settings, size, width, height);
break;
}
case GTK_IMAGE_ICON_SET:
{
GtkIconSize size;
GtkSettings *settings;
settings = gtk_settings_get_for_screen (gtk_widget_get_screen (widget));
gtk_image_get_icon_set(gtk_image, NULL, &size);
gtk_icon_size_lookup(size, width, height);
gtk_icon_size_lookup_for_settings (settings, size, width, height);
break;
}
case GTK_IMAGE_ANIMATION:

View File

@ -1247,6 +1247,7 @@ gail_text_view_copy_text (AtkEditableText *text,
GtkTextBuffer *buffer;
GtkTextIter start, end;
gchar *str;
GtkClipboard *clipboard;
widget = GTK_ACCESSIBLE (text)->widget;
if (widget == NULL)
@ -1259,7 +1260,9 @@ gail_text_view_copy_text (AtkEditableText *text,
gtk_text_buffer_get_iter_at_offset (buffer, &start, start_pos);
gtk_text_buffer_get_iter_at_offset (buffer, &end, end_pos);
str = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
gtk_clipboard_set_text (gtk_clipboard_get (GDK_NONE), str, -1);
clipboard = gtk_clipboard_get_for_display (gtk_widget_get_display (widget),
GDK_SELECTION_CLIPBOARD);
gtk_clipboard_set_text (clipboard, str, -1);
}
static void
@ -1272,6 +1275,7 @@ gail_text_view_cut_text (AtkEditableText *text,
GtkTextBuffer *buffer;
GtkTextIter start, end;
gchar *str;
GtkClipboard *clipboard;
widget = GTK_ACCESSIBLE (text)->widget;
if (widget == NULL)
@ -1286,7 +1290,9 @@ gail_text_view_cut_text (AtkEditableText *text,
gtk_text_buffer_get_iter_at_offset (buffer, &start, start_pos);
gtk_text_buffer_get_iter_at_offset (buffer, &end, end_pos);
str = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
gtk_clipboard_set_text (gtk_clipboard_get (GDK_NONE), str, -1);
clipboard = gtk_clipboard_get_for_display (gtk_widget_get_display (widget),
GDK_SELECTION_CLIPBOARD);
gtk_clipboard_set_text (clipboard, str, -1);
gtk_text_buffer_delete (buffer, &start, &end);
}
@ -1324,6 +1330,7 @@ gail_text_view_paste_text (AtkEditableText *text,
GtkWidget *widget;
GtkTextBuffer *buffer;
GailTextViewPaste paste_struct;
GtkClipboard *clipboard;
widget = GTK_ACCESSIBLE (text)->widget;
if (widget == NULL)
@ -1339,7 +1346,9 @@ gail_text_view_paste_text (AtkEditableText *text,
paste_struct.position = position;
g_object_ref (paste_struct.buffer);
gtk_clipboard_request_text (gtk_clipboard_get (GDK_NONE),
clipboard = gtk_clipboard_get_for_display (gtk_widget_get_display (widget),
GDK_SELECTION_CLIPBOARD);
gtk_clipboard_request_text (clipboard,
gail_text_view_paste_received, &paste_struct);
}