projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0172359
)
Made some gui functions multi-head safe.
author
John Darrington
<john@darrington.wattle.id.au>
Tue, 11 Nov 2008 12:00:58 +0000
(21:00 +0900)
committer
John Darrington
<john@darrington.wattle.id.au>
Tue, 11 Nov 2008 12:00:58 +0000
(21:00 +0900)
src/ui/gui/message-dialog.c
patch
|
blob
|
history
src/ui/gui/message-dialog.h
patch
|
blob
|
history
src/ui/gui/psppire-data-editor.c
patch
|
blob
|
history
src/ui/gui/text-data-import-dialog.c
patch
|
blob
|
history
diff --git
a/src/ui/gui/message-dialog.c
b/src/ui/gui/message-dialog.c
index 140cea7e55a4e34f3c25061a669a13c0d2cb7297..281ef527d55f357ab3897743c884a58a16e76cfd 100644
(file)
--- a/
src/ui/gui/message-dialog.c
+++ b/
src/ui/gui/message-dialog.c
@@
-50,7
+50,7
@@
static GQueue *late_queue;
static int error_cnt, warning_cnt, note_cnt;
static GladeXML *message_xml;
static int error_cnt, warning_cnt, note_cnt;
static GladeXML *message_xml;
-static Gtk
Dialog
*message_dialog;
+static Gtk
Widget
*message_dialog;
void
message_dialog_init (struct source_stream *ss)
void
message_dialog_init (struct source_stream *ss)
@@
-61,8
+61,7
@@
message_dialog_init (struct source_stream *ss)
error_cnt = warning_cnt = note_cnt = 0;
msg_init (ss, enqueue_msg);
message_xml = XML_NEW ("message-dialog.glade");
error_cnt = warning_cnt = note_cnt = 0;
msg_init (ss, enqueue_msg);
message_xml = XML_NEW ("message-dialog.glade");
- message_dialog = GTK_DIALOG (get_widget_assert (message_xml,
- "message-dialog"));
+ message_dialog = get_widget_assert (message_xml, "message-dialog");
}
void
}
void
@@
-72,7
+71,7
@@
message_dialog_done (void)
g_queue_free (early_queue);
dropped_messages = 0;
g_queue_free (late_queue);
g_queue_free (early_queue);
dropped_messages = 0;
g_queue_free (late_queue);
- gtk_widget_destroy (
GTK_WIDGET (message_dialog)
);
+ gtk_widget_destroy (
message_dialog
);
g_object_unref (message_xml);
}
g_object_unref (message_xml);
}
@@
-183,7
+182,7
@@
enqueue_msg (const struct msg *msg)
}
}
}
}
-gboolean
+
static
gboolean
popup_messages (gpointer unused UNUSED)
{
GtkTextBuffer *text_buffer;
popup_messages (gpointer unused UNUSED)
{
GtkTextBuffer *text_buffer;
@@
-194,12
+193,20
@@
popup_messages (gpointer unused UNUSED)
struct string msg = DS_EMPTY_INITIALIZER;
int message_cnt;
struct string msg = DS_EMPTY_INITIALIZER;
int message_cnt;
+ /* Set up the dialog. */
+ if (message_xml == NULL || message_dialog == NULL)
+ goto use_fallback;
+
/* If a pointer grab is in effect, then the combination of that, and
a modal dialog box, will cause an impossible situation.
So don't pop it up just yet.
*/
/* If a pointer grab is in effect, then the combination of that, and
a modal dialog box, will cause an impossible situation.
So don't pop it up just yet.
*/
- if ( gdk_pointer_is_grabbed ())
- return TRUE;
+ if ( gdk_display_pointer_is_grabbed (gtk_widget_get_display (message_dialog)))
+ {
+ ds_destroy (&lead);
+ ds_destroy (&msg);
+ return TRUE;
+ }
/* Compose the lead-in. */
message_cnt = error_cnt + warning_cnt + note_cnt;
/* Compose the lead-in. */
message_cnt = error_cnt + warning_cnt + note_cnt;
@@
-239,10
+246,6
@@
popup_messages (gpointer unused UNUSED)
while (!g_queue_is_empty (late_queue))
format_message (g_queue_pop_head (late_queue), &msg);
while (!g_queue_is_empty (late_queue))
format_message (g_queue_pop_head (late_queue), &msg);
- /* Set up the dialog. */
- if (message_xml == NULL || message_dialog == NULL)
- goto use_fallback;
-
text_buffer = gtk_text_buffer_new (NULL);
gtk_text_buffer_get_end_iter (text_buffer, &end);
gtk_text_buffer_insert (text_buffer, &end, ds_data (&msg), ds_length (&msg));
text_buffer = gtk_text_buffer_new (NULL);
gtk_text_buffer_get_end_iter (text_buffer, &end);
gtk_text_buffer_insert (text_buffer, &end, ds_data (&msg), ds_length (&msg));
@@
-257,8
+260,8
@@
popup_messages (gpointer unused UNUSED)
goto use_fallback;
gtk_text_view_set_buffer (text_view, text_buffer);
goto use_fallback;
gtk_text_view_set_buffer (text_view, text_buffer);
- gtk_dialog_run (
message_dialog
);
- gtk_widget_hide (
GTK_WIDGET (message_dialog)
);
+ gtk_dialog_run (
GTK_DIALOG (message_dialog)
);
+ gtk_widget_hide (
message_dialog
);
ds_destroy (&lead);
ds_destroy (&msg);
ds_destroy (&lead);
ds_destroy (&msg);
diff --git
a/src/ui/gui/message-dialog.h
b/src/ui/gui/message-dialog.h
index 9fc53161a4884c9616cf9fa5a61b566c94ff64f3..45eeca68beffda26b705fb2228f41025c81dd5e6 100644
(file)
--- a/
src/ui/gui/message-dialog.h
+++ b/
src/ui/gui/message-dialog.h
@@
-23,6
+23,5
@@
struct source_stream ;
void message_dialog_init (struct source_stream *);
void message_dialog_done (void);
void message_dialog_init (struct source_stream *);
void message_dialog_done (void);
-void popup_message (const struct msg *m);
#endif
#endif
diff --git
a/src/ui/gui/psppire-data-editor.c
b/src/ui/gui/psppire-data-editor.c
index 3a6152a587b3021615c62fd1b18edf22f5adec64..1db96b155652fdd04198e4c3ef8bd3dab6a7975a 100644
(file)
--- a/
src/ui/gui/psppire-data-editor.c
+++ b/
src/ui/gui/psppire-data-editor.c
@@
-688,7
+688,9
@@
psppire_data_editor_clip_copy (PsppireDataEditor *de)
void
psppire_data_editor_clip_paste (PsppireDataEditor *de)
{
void
psppire_data_editor_clip_paste (PsppireDataEditor *de)
{
- GtkClipboard *clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
+ GdkDisplay *display = gtk_widget_get_display ( GTK_WIDGET (de));
+ GtkClipboard *clipboard =
+ gtk_clipboard_get_for_display (display, GDK_SELECTION_CLIPBOARD);
gtk_clipboard_request_contents (clipboard,
gdk_atom_intern ("UTF8_STRING", TRUE),
gtk_clipboard_request_contents (clipboard,
gdk_atom_intern ("UTF8_STRING", TRUE),
diff --git
a/src/ui/gui/text-data-import-dialog.c
b/src/ui/gui/text-data-import-dialog.c
index 11ca7b044e70e3e99196e99856f2a9d7ab6ee01f..a029198ae328e831621c61d70b1719f0efa7b565 100644
(file)
--- a/
src/ui/gui/text-data-import-dialog.c
+++ b/
src/ui/gui/text-data-import-dialog.c
@@
-2292,10
+2292,11
@@
push_watch_cursor (struct import_assistant *ia)
if (++ia->asst.watch_cursor == 1)
{
GtkWidget *widget = GTK_WIDGET (ia->asst.assistant);
if (++ia->asst.watch_cursor == 1)
{
GtkWidget *widget = GTK_WIDGET (ia->asst.assistant);
- GdkCursor *cursor = gdk_cursor_new (GDK_WATCH);
+ GdkDisplay *display = gtk_widget_get_display (widget);
+ GdkCursor *cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
gdk_window_set_cursor (widget->window, cursor);
gdk_cursor_unref (cursor);
gdk_window_set_cursor (widget->window, cursor);
gdk_cursor_unref (cursor);
- gdk_display_flush (
gtk_widget_get_display (widget)
);
+ gdk_display_flush (
display
);
}
}
}
}