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
This commit is contained in:
Havoc Pennington 2002-03-23 04:37:53 +00:00 committed by Havoc Pennington
parent 56c5bd70a3
commit 8d3df4d9a1
10 changed files with 216 additions and 50 deletions

View 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

View 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

View 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

View 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

View 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

View 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

View 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);
}

View 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);

View 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");

View 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;