summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2002-03-23 04:37:53 +0000
committerHavoc Pennington <hp@src.gnome.org>2002-03-23 04:37:53 +0000
commit8d3df4d9a1bea9b3893940fb225e815cabd42d09 (patch)
tree37d8ed6dd07d8048cd9aaf4c89e9a86909c236e7
parent56c5bd70a356a30d8bc2fbf5c88083219558768b (diff)
downloadgdk-pixbuf-8d3df4d9a1bea9b3893940fb225e815cabd42d09.tar.gz
add more explanatory text to the error message about missing charsets, and
2002-03-22 Havoc Pennington <hp@pobox.com> * gdk/x11/gdkfont-x11.c (gdk_fontset_load): add more explanatory text to the error message about missing charsets, and use g_printerr() not g_warning() since this is typically not a programming error (we do not export any API to ask whether a font set will have missing charsets so apps realistically can't do anything other than try the gdk_fontset_load()) * gtk/gtktextview.c (gtk_text_view_key_press_event): return FALSE if the text view isn't editable and the user presses Return, so default buttons and such can be activated, #74937 * gtk/gtktextbuffer.c (paste_from_buffer): don't insert if the insertion point is not editable and the paste is interactive, #74125 * gtk/gtkwindow.c (gtk_window_move_resize): enhance the #if 0 debug spew * gtk/gtktextbuffer.c (cut_or_copy): only remove the previous cut/copied data right before replacing it, when we know we are going to replace it. Fixes #74049
-rw-r--r--ChangeLog24
-rw-r--r--ChangeLog.pre-2-1024
-rw-r--r--ChangeLog.pre-2-224
-rw-r--r--ChangeLog.pre-2-424
-rw-r--r--ChangeLog.pre-2-624
-rw-r--r--ChangeLog.pre-2-824
-rw-r--r--gdk/x11/gdkfont-x11.c7
-rw-r--r--gtk/gtktextbuffer.c25
-rw-r--r--gtk/gtktextview.c18
-rw-r--r--gtk/gtkwindow.c72
10 files changed, 216 insertions, 50 deletions
diff --git a/ChangeLog b/ChangeLog
index b9bcaf8dc..d19050c80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2002-03-22 Havoc Pennington <hp@pobox.com>
+
+ * gdk/x11/gdkfont-x11.c (gdk_fontset_load): add more explanatory
+ text to the error message about missing charsets, and use
+ g_printerr() not g_warning() since this is typically not a
+ programming error (we do not export any API to ask whether
+ a font set will have missing charsets so apps realistically can't
+ do anything other than try the gdk_fontset_load())
+
+ * gtk/gtktextview.c (gtk_text_view_key_press_event): return FALSE
+ if the text view isn't editable and the user presses Return,
+ so default buttons and such can be activated, #74937
+
+ * gtk/gtktextbuffer.c (paste_from_buffer): don't insert
+ if the insertion point is not editable and the paste
+ is interactive, #74125
+
+ * gtk/gtkwindow.c (gtk_window_move_resize): enhance the #if 0
+ debug spew
+
+ * gtk/gtktextbuffer.c (cut_or_copy): only remove the previous
+ cut/copied data right before replacing it, when we know we are
+ going to replace it. Fixes #74049
+
2002-03-22 Richard Hult <rhult@codefactory.se>
* gdk/gdkevents.c (gdk_event_get_root_coords): Fix typo, where x
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index b9bcaf8dc..d19050c80 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,27 @@
+2002-03-22 Havoc Pennington <hp@pobox.com>
+
+ * gdk/x11/gdkfont-x11.c (gdk_fontset_load): add more explanatory
+ text to the error message about missing charsets, and use
+ g_printerr() not g_warning() since this is typically not a
+ programming error (we do not export any API to ask whether
+ a font set will have missing charsets so apps realistically can't
+ do anything other than try the gdk_fontset_load())
+
+ * gtk/gtktextview.c (gtk_text_view_key_press_event): return FALSE
+ if the text view isn't editable and the user presses Return,
+ so default buttons and such can be activated, #74937
+
+ * gtk/gtktextbuffer.c (paste_from_buffer): don't insert
+ if the insertion point is not editable and the paste
+ is interactive, #74125
+
+ * gtk/gtkwindow.c (gtk_window_move_resize): enhance the #if 0
+ debug spew
+
+ * gtk/gtktextbuffer.c (cut_or_copy): only remove the previous
+ cut/copied data right before replacing it, when we know we are
+ going to replace it. Fixes #74049
+
2002-03-22 Richard Hult <rhult@codefactory.se>
* gdk/gdkevents.c (gdk_event_get_root_coords): Fix typo, where x
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index b9bcaf8dc..d19050c80 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,27 @@
+2002-03-22 Havoc Pennington <hp@pobox.com>
+
+ * gdk/x11/gdkfont-x11.c (gdk_fontset_load): add more explanatory
+ text to the error message about missing charsets, and use
+ g_printerr() not g_warning() since this is typically not a
+ programming error (we do not export any API to ask whether
+ a font set will have missing charsets so apps realistically can't
+ do anything other than try the gdk_fontset_load())
+
+ * gtk/gtktextview.c (gtk_text_view_key_press_event): return FALSE
+ if the text view isn't editable and the user presses Return,
+ so default buttons and such can be activated, #74937
+
+ * gtk/gtktextbuffer.c (paste_from_buffer): don't insert
+ if the insertion point is not editable and the paste
+ is interactive, #74125
+
+ * gtk/gtkwindow.c (gtk_window_move_resize): enhance the #if 0
+ debug spew
+
+ * gtk/gtktextbuffer.c (cut_or_copy): only remove the previous
+ cut/copied data right before replacing it, when we know we are
+ going to replace it. Fixes #74049
+
2002-03-22 Richard Hult <rhult@codefactory.se>
* gdk/gdkevents.c (gdk_event_get_root_coords): Fix typo, where x
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index b9bcaf8dc..d19050c80 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,27 @@
+2002-03-22 Havoc Pennington <hp@pobox.com>
+
+ * gdk/x11/gdkfont-x11.c (gdk_fontset_load): add more explanatory
+ text to the error message about missing charsets, and use
+ g_printerr() not g_warning() since this is typically not a
+ programming error (we do not export any API to ask whether
+ a font set will have missing charsets so apps realistically can't
+ do anything other than try the gdk_fontset_load())
+
+ * gtk/gtktextview.c (gtk_text_view_key_press_event): return FALSE
+ if the text view isn't editable and the user presses Return,
+ so default buttons and such can be activated, #74937
+
+ * gtk/gtktextbuffer.c (paste_from_buffer): don't insert
+ if the insertion point is not editable and the paste
+ is interactive, #74125
+
+ * gtk/gtkwindow.c (gtk_window_move_resize): enhance the #if 0
+ debug spew
+
+ * gtk/gtktextbuffer.c (cut_or_copy): only remove the previous
+ cut/copied data right before replacing it, when we know we are
+ going to replace it. Fixes #74049
+
2002-03-22 Richard Hult <rhult@codefactory.se>
* gdk/gdkevents.c (gdk_event_get_root_coords): Fix typo, where x
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index b9bcaf8dc..d19050c80 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,27 @@
+2002-03-22 Havoc Pennington <hp@pobox.com>
+
+ * gdk/x11/gdkfont-x11.c (gdk_fontset_load): add more explanatory
+ text to the error message about missing charsets, and use
+ g_printerr() not g_warning() since this is typically not a
+ programming error (we do not export any API to ask whether
+ a font set will have missing charsets so apps realistically can't
+ do anything other than try the gdk_fontset_load())
+
+ * gtk/gtktextview.c (gtk_text_view_key_press_event): return FALSE
+ if the text view isn't editable and the user presses Return,
+ so default buttons and such can be activated, #74937
+
+ * gtk/gtktextbuffer.c (paste_from_buffer): don't insert
+ if the insertion point is not editable and the paste
+ is interactive, #74125
+
+ * gtk/gtkwindow.c (gtk_window_move_resize): enhance the #if 0
+ debug spew
+
+ * gtk/gtktextbuffer.c (cut_or_copy): only remove the previous
+ cut/copied data right before replacing it, when we know we are
+ going to replace it. Fixes #74049
+
2002-03-22 Richard Hult <rhult@codefactory.se>
* gdk/gdkevents.c (gdk_event_get_root_coords): Fix typo, where x
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index b9bcaf8dc..d19050c80 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,27 @@
+2002-03-22 Havoc Pennington <hp@pobox.com>
+
+ * gdk/x11/gdkfont-x11.c (gdk_fontset_load): add more explanatory
+ text to the error message about missing charsets, and use
+ g_printerr() not g_warning() since this is typically not a
+ programming error (we do not export any API to ask whether
+ a font set will have missing charsets so apps realistically can't
+ do anything other than try the gdk_fontset_load())
+
+ * gtk/gtktextview.c (gtk_text_view_key_press_event): return FALSE
+ if the text view isn't editable and the user presses Return,
+ so default buttons and such can be activated, #74937
+
+ * gtk/gtktextbuffer.c (paste_from_buffer): don't insert
+ if the insertion point is not editable and the paste
+ is interactive, #74125
+
+ * gtk/gtkwindow.c (gtk_window_move_resize): enhance the #if 0
+ debug spew
+
+ * gtk/gtktextbuffer.c (cut_or_copy): only remove the previous
+ cut/copied data right before replacing it, when we know we are
+ going to replace it. Fixes #74049
+
2002-03-22 Richard Hult <rhult@codefactory.se>
* gdk/gdkevents.c (gdk_event_get_root_coords): Fix typo, where x
diff --git a/gdk/x11/gdkfont-x11.c b/gdk/x11/gdkfont-x11.c
index 4cf8a4d74..420a6c6e3 100644
--- a/gdk/x11/gdkfont-x11.c
+++ b/gdk/x11/gdkfont-x11.c
@@ -26,6 +26,7 @@
#include <X11/Xlib.h>
#include <X11/Xos.h>
+#include <locale.h>
#include <pango/pangox.h>
@@ -263,9 +264,11 @@ gdk_fontset_load (const gchar *fontset_name)
if (missing_charset_count)
{
gint i;
- g_warning ("Missing charsets in FontSet creation\n");
+ g_printerr ("The font \"%s\" does not support all the required character sets for the current locale \"%s\"\n",
+ fontset_name, setlocale (LC_ALL, NULL));
for (i=0;i<missing_charset_count;i++)
- g_warning (" %s\n", missing_charset_list[i]);
+ g_printerr (" (Missing character set \"%s\")\n",
+ missing_charset_list[i]);
XFreeStringList (missing_charset_list);
}
diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c
index 69deec971..554f8315a 100644
--- a/gtk/gtktextbuffer.c
+++ b/gtk/gtktextbuffer.c
@@ -2737,9 +2737,12 @@ clipboard_get_contents_cb (GtkClipboard *clipboard,
guint info,
gpointer data)
{
- GtkTextBuffer *buffer = GTK_TEXT_BUFFER (data);
- GtkTextBuffer *contents = get_clipboard_contents_buffer (buffer, clipboard, FALSE);
+ GtkTextBuffer *buffer;
+ GtkTextBuffer *contents;
+ buffer = GTK_TEXT_BUFFER (data);
+ contents = get_clipboard_contents_buffer (buffer, clipboard, FALSE);
+
g_assert (contents); /* This should never be called unless we own the clipboard */
if (selection_data->target ==
@@ -2952,11 +2955,14 @@ paste_from_buffer (ClipboardRequest *request_data,
if (!gtk_text_iter_equal (start, end))
{
- gtk_text_buffer_real_insert_range (request_data->buffer,
- &insert_point,
- start,
- end,
- request_data->interactive);
+ if (!request_data->interactive ||
+ (gtk_text_iter_can_insert (&insert_point,
+ request_data->default_editable)))
+ gtk_text_buffer_real_insert_range (request_data->buffer,
+ &insert_point,
+ start,
+ end,
+ request_data->interactive);
}
post_paste_cleanup (request_data);
@@ -3263,8 +3269,6 @@ cut_or_copy (GtkTextBuffer *buffer,
*/
GtkTextIter start;
GtkTextIter end;
-
- remove_clipboard_contents_buffer (buffer, clipboard);
if (!gtk_text_buffer_get_selection_bounds (buffer, &start, &end))
{
@@ -3284,7 +3288,8 @@ cut_or_copy (GtkTextBuffer *buffer,
{
GtkTextIter ins;
GtkTextBuffer *contents;
-
+
+ remove_clipboard_contents_buffer (buffer, clipboard);
contents = get_clipboard_contents_buffer (buffer, clipboard, TRUE);
gtk_text_buffer_get_iter_at_offset (contents, &ins, 0);
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 876cb9622..230cc8331 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -3587,6 +3587,7 @@ gtk_text_view_key_press_event (GtkWidget *widget, GdkEventKey *event)
GtkTextView *text_view = GTK_TEXT_VIEW (widget);
GtkTextMark *insert;
GtkTextIter iter;
+ gboolean can_insert;
if (text_view->layout == NULL ||
get_buffer (text_view) == NULL)
@@ -3594,19 +3595,26 @@ gtk_text_view_key_press_event (GtkWidget *widget, GdkEventKey *event)
insert = gtk_text_buffer_get_insert (get_buffer (text_view));
gtk_text_buffer_get_iter_at_mark (get_buffer (text_view), &iter, insert);
- if (gtk_text_iter_can_insert (&iter, text_view->editable) &&
+ can_insert = gtk_text_iter_can_insert (&iter, text_view->editable);
+ if (can_insert &&
gtk_im_context_filter_keypress (text_view->im_context, event))
{
text_view->need_im_reset = TRUE;
obscure = TRUE;
retval = TRUE;
}
+ /* Binding set */
else if (GTK_WIDGET_CLASS (parent_class)->key_press_event &&
GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event))
retval = TRUE;
- else if (event->keyval == GDK_Return ||
- event->keyval == GDK_KP_Enter)
+ /* use overall editability not can_insert, more predictable for users */
+ else if (text_view->editable &&
+ (event->keyval == GDK_Return ||
+ event->keyval == GDK_KP_Enter))
{
+ /* this won't actually insert the newline if the cursor isn't
+ * editable
+ */
gtk_text_view_commit_text (text_view, "\n");
obscure = TRUE;
@@ -3617,7 +3625,9 @@ gtk_text_view_key_press_event (GtkWidget *widget, GdkEventKey *event)
event->keyval == GDK_KP_Tab) &&
!(event->state & GDK_CONTROL_MASK))
{
- /* If the text isn't editable, move the focus instead */
+ /* If the text widget isn't editable overall, move the focus
+ * instead
+ */
if (text_view->editable)
{
gtk_text_view_commit_text (text_view, "\t");
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 41c6486ca..0c2e3e499 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -4266,42 +4266,46 @@ gtk_window_move_resize (GtkWindow *window)
}
#if 0
- {
- int notify_x, notify_y;
+ if (window->type == GTK_WINDOW_TOPLEVEL)
+ {
+ int notify_x, notify_y;
- /* this is the position from the last configure notify */
- gdk_window_get_position (widget->window, &notify_x, &notify_y);
+ /* this is the position from the last configure notify */
+ gdk_window_get_position (widget->window, &notify_x, &notify_y);
- g_print ("--- %s ---\n"
- "last : %d,%d\t%d x %d\n"
- "this : %d,%d\t%d x %d\n"
- "alloc: %d,%d\t%d x %d\n"
- "req : \t%d x %d\n"
- "size_changed: %d pos_changed: %d hints_changed: %d\n"
- "configure_notify_received: %d\n"
- "configure_request_count: %d\n"
- "position_constraints_changed: %d\n",
- window->title ? window->title : "(no title)",
- info->last.configure_request.x,
- info->last.configure_request.y,
- info->last.configure_request.width,
- info->last.configure_request.height,
- new_request.x,
- new_request.y,
- new_request.width,
- new_request.height,
- notify_x, notify_y,
- widget->allocation.width,
- widget->allocation.height,
- widget->requisition.width,
- widget->requisition.height,
- configure_request_pos_changed,
- configure_request_size_changed,
- hints_changed,
- window->configure_notify_received,
- window->configure_request_count,
- info->position_constraints_changed);
- }
+ g_print ("--- %s ---\n"
+ "last : %d,%d\t%d x %d\n"
+ "this : %d,%d\t%d x %d\n"
+ "alloc : %d,%d\t%d x %d\n"
+ "req : \t%d x %d\n"
+ "resize: \t%d x %d\n"
+ "size_changed: %d pos_changed: %d hints_changed: %d\n"
+ "configure_notify_received: %d\n"
+ "configure_request_count: %d\n"
+ "position_constraints_changed: %d\n",
+ window->title ? window->title : "(no title)",
+ info->last.configure_request.x,
+ info->last.configure_request.y,
+ info->last.configure_request.width,
+ info->last.configure_request.height,
+ new_request.x,
+ new_request.y,
+ new_request.width,
+ new_request.height,
+ notify_x, notify_y,
+ widget->allocation.width,
+ widget->allocation.height,
+ widget->requisition.width,
+ widget->requisition.height,
+ info->resize_width,
+ info->resize_height,
+ configure_request_pos_changed,
+ configure_request_size_changed,
+ hints_changed,
+ window->configure_notify_received,
+ window->configure_request_count,
+ info->position_constraints_changed);
+ }
#endif
saved_last_info = info->last;