summaryrefslogtreecommitdiff
path: root/gtk/gtkwindow.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@gtk.org>1998-05-10 02:46:20 +0000
committerOwen Taylor <otaylor@src.gnome.org>1998-05-10 02:46:20 +0000
commitf75d8b0c23e8ea8cd31afd8ac16aa85324aa4ff5 (patch)
tree3fc54e99797c9aea92f56c3b0104f0537ab112e4 /gtk/gtkwindow.c
parentaab3106abd20dfc51a3d3132d98c9f269ef20ee0 (diff)
downloadgtk+-f75d8b0c23e8ea8cd31afd8ac16aa85324aa4ff5.tar.gz
Try to figure out if this is Digital Unix and we need -std1 to get the
Sat May 9 20:11:20 1998 Owen Taylor <otaylor@gtk.org> * configure.in (LIBS): Try to figure out if this is Digital Unix and we need -std1 to get the right prototypes. Sat May 9 20:08:12 1998 Owen Taylor <otaylor@gtk.org> * glib/gmem.c: Experimentally restore GMemChunk to its primeval state - where mem areas are freed incrementally instead of searching the tree every time a mem area is completely empty. Also, always keep one mem chunk around. (Reduced calls to malloc() a lot, but doesn't really improve performance significiantly) Fri May 8 21:31:50 1998 Owen Taylor <otaylor@gtk.org> * gtk/gtkwidget.c (gtk_widget_queue_draw): Free the draw-queue when we are done. (gtk_widget_queue_draw/_queu_resize): Always return FALSE and avoid having two idles at the same time. Fri May 8 21:04:00 1998 Owen Taylor <otaylor@gtk.org> * gtk/gtktext.c: Various fixes to make sure cache lines are freed if line_start_cache doesn't point to the beginning of the cache. Thu May 7 09:44:22 1998 Owen Taylor <otaylor@gtk.org> * style_set improvements for GtkText and GtkEntry Tue May 5 19:49:27 1998 Owen Taylor <otaylor@gtk.org> * gdk/gdkpixmap.c: Patches from Gordon Matzigkeit to speed things up and remove code duplication. Reintegrated buffer overflow patches, and added some extra paranoia. Tue May 5 17:04:14 1998 Owen Taylor <otaylor@gtk.org> * gdk/gdk.c (gdk_event_translate): A guint * was being passed where X expected a Keysym *, and keysyms are long's on Alpha Linux. This was causing segfaults in Xlib, apparently because of alignment. (Bug located by Juergen Haas <haas@forwiss.uni-passau.de>) Tue May 5 19:11:27 1998 Owen Taylor <otaylor@gtk.org> * gtk/gtkdrawingarea.c (gtk_drawing_area_realize): Always set GDK_EXPOSURE_MASK for DrawingAreas Tue May 5 14:32:37 1998 Owen Taylor <otaylor@gtk.org> * gtk/gtkwidget.[ch]: removed gtk_widge_propagate_default_style (superceded by RC file reparsing capabilities) * gtk/gtkwindow.c: Add handling for _GDK_READ_RFCILES client events. (Shouldn't be sent to the InputOnly leader, which it is now by gdk_event_send_clientmessage_toall * gtk/testgtk.c: Added extra button to rcfiles test to send out _GDK_READ_RCFILES events. Tue May 5 11:03:00 1998 Owen Taylor <otaylor@gtk.org> * gtk/gtkselection.c (gtk_selection_clear): Fixed reversed conditionals that caused segfault on some platforms. Tue May 5 00:44:47 1998 Owen Taylor <otaylor@gtk.org> * gtk/gtkcontainer.c (gtk_container_set_focus_[hv]adjustment): cast to GTK_OBJECT for gtk_object_ref.
Diffstat (limited to 'gtk/gtkwindow.c')
-rw-r--r--gtk/gtkwindow.c79
1 files changed, 28 insertions, 51 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 2d68eb1114..9608b081a5 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -22,6 +22,7 @@
#include "gdk/gdkkeysyms.h"
#include "gdk/gdkx.h"
#include "gtkprivate.h"
+#include "gtkrc.h"
#include "gtksignal.h"
#include "gtkwindow.h"
@@ -110,6 +111,9 @@ static gint gtk_window_check_accelerator (GtkWindow *window,
gint key,
guint mods);
+static void gtk_window_read_rcfiles (GtkWidget *widget,
+ GdkEventClient *event);
+
static GtkBinClass *parent_class = NULL;
static guint window_signals[LAST_SIGNAL] = { 0 };
@@ -942,70 +946,43 @@ gtk_window_focus_out_event (GtkWidget *widget,
}
static void
-gtk_window_style_set_event (GtkWidget *widget,
- GdkEventClient *event)
+gtk_window_read_rcfiles (GtkWidget *widget,
+ GdkEventClient *event)
{
- GdkAtom atom_default_colors;
- GtkStyle *style_newdefault;
- GdkAtom realtype;
- gint retfmt, retlen;
- GdkColor *data, *stylecolors;
- int i = 0;
- GdkColormap *widget_cmap;
-
- atom_default_colors = gdk_atom_intern("_GTK_DEFAULT_COLORS", FALSE);
+ GList *toplevels;
- if(gdk_property_get (GDK_ROOT_PARENT(),
- atom_default_colors,
- gdk_atom_intern("STRING", FALSE),
- 0,
- sizeof(GdkColor) * GTK_STYLE_NUM_STYLECOLORS(),
- FALSE,
- &realtype,
- &retfmt,
- &retlen,
- (guchar **)&data) != TRUE) {
- g_warning("gdk_property_get() failed in _GTK_STYLE_CHANGED handler\n");
- return;
- }
- if(retfmt != sizeof(gushort)*8) {
- g_warning("retfmt (%d) != sizeof(gushort)*8 (%d)\n", retfmt,
- sizeof(gushort)*8);
- return;
- }
- /* We have the color data, now let's interpret it */
- style_newdefault = gtk_widget_get_default_style();
- gtk_style_ref(style_newdefault);
- stylecolors = (GdkColor *) style_newdefault;
-
- widget_cmap = gtk_widget_get_colormap(widget);
- for(i = 0; i < GTK_STYLE_NUM_STYLECOLORS(); i++) {
- stylecolors[i] = data[i];
- gdk_color_alloc(widget_cmap, &stylecolors[i]);
- }
-
- gtk_widget_set_default_style(style_newdefault);
- gtk_style_unref(style_newdefault);
-
- /* Now we need to redraw everything */
- gtk_widget_draw(widget, NULL);
- gtk_widget_draw_children(widget);
+ if (gtk_rc_reparse_all ())
+ {
+ toplevels = gdk_window_get_toplevels();
+ while (toplevels)
+ {
+ GtkWidget *widget;
+ gdk_window_get_user_data (toplevels->data, (gpointer *)&widget);
+
+ if (widget)
+ gtk_widget_reset_rc_styles (widget);
+
+ toplevels = toplevels->next;
+ }
+ g_list_free (toplevels);
+ }
}
static gint
gtk_window_client_event (GtkWidget *widget,
GdkEventClient *event)
{
- GdkAtom atom_styleset;
+ static GdkAtom atom_rcfiles = GDK_NONE;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_WINDOW (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
- atom_styleset = gdk_atom_intern("_GTK_STYLE_CHANGED", FALSE);
+ if (!atom_rcfiles)
+ atom_rcfiles = gdk_atom_intern("_GTK_READ_RCFILES", FALSE);
+
+ if(event->message_type == atom_rcfiles)
+ gtk_window_read_rcfiles (widget, event);
- if(event->message_type == atom_styleset) {
- gtk_window_style_set_event(widget, event);
- }
return FALSE;
}