]> Pileus Git - ~andy/gtk/commitdiff
add more explanatory text to the error message about missing charsets, and
authorHavoc Pennington <hp@pobox.com>
Sat, 23 Mar 2002 04:37:53 +0000 (04:37 +0000)
committerHavoc Pennington <hp@src.gnome.org>
Sat, 23 Mar 2002 04:37:53 +0000 (04:37 +0000)
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

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/x11/gdkfont-x11.c
gtk/gtktextbuffer.c
gtk/gtktextview.c
gtk/gtkwindow.c

index b9bcaf8dcd0b21742a25e6b8c913f28633a9f4df..d19050c8057dfff482121d60eb7fd79b1574b6a8 100644 (file)
--- 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
index b9bcaf8dcd0b21742a25e6b8c913f28633a9f4df..d19050c8057dfff482121d60eb7fd79b1574b6a8 100644 (file)
@@ -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
index b9bcaf8dcd0b21742a25e6b8c913f28633a9f4df..d19050c8057dfff482121d60eb7fd79b1574b6a8 100644 (file)
@@ -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
index b9bcaf8dcd0b21742a25e6b8c913f28633a9f4df..d19050c8057dfff482121d60eb7fd79b1574b6a8 100644 (file)
@@ -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
index b9bcaf8dcd0b21742a25e6b8c913f28633a9f4df..d19050c8057dfff482121d60eb7fd79b1574b6a8 100644 (file)
@@ -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
index b9bcaf8dcd0b21742a25e6b8c913f28633a9f4df..d19050c8057dfff482121d60eb7fd79b1574b6a8 100644 (file)
@@ -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
index 4cf8a4d747bb0483435e8fb2ce42f6850358dfe3..420a6c6e3dd216cdda7a360765d5a093064722e5 100644 (file)
@@ -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);
     }
 
index 69deec9714eeb0cbcb20d3801e722f726f05d61a..554f8315aec8e3cdffc2f79cd08c8134fe2a6eea 100644 (file)
@@ -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);
index 876cb96229e41b8d5242e025d269dd8582ebcdb2..230cc83318a23d3bc74eaf0261138a888fd7aa36 100644 (file)
@@ -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");
index 41c6486ca2dfe7aecb04905df774d72477087da9..0c2e3e49923630fa350b00c2da91b4df4d07e4b6 100644 (file)
@@ -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;