multihead problems
- From: Mark McLoughlin <mark skynet ie>
- To: gtk-devel-list gnome org
- Subject: multihead problems
- Date: Thu, 6 Jun 2002 05:50:41 +0100 (IST)
Hey,
I've a couple of problems with multihead support ..
* There seems to be no way to parse a gtkrc string with a
specific context, and thus, for a specific screen. I've
attached a patch which splits out the context specific
stuff into gtk_rc_parse_string_with_context.
* I'm getting some warnings about using gtk_window_get_pointer
with window = NULL. Fix for that below too.
Does the patch look reasonable ?
Cheers,
Mark.
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtk+/ChangeLog,v
retrieving revision 1.3471
diff -u -p -r1.3471 ChangeLog
--- ChangeLog 6 Jun 2002 00:26:14 -0000 1.3471
+++ ChangeLog 6 Jun 2002 04:43:04 -0000
@@ -1,3 +1,15 @@
+2002-06-07 Mark McLoughlin <mark skynet ie>
+
+ * gtk/gtkrc.[ch]:
+ (gtk_rc_parse_string_with_context): split gtk_rc_parse_string
+ into a context aware method.
+ (gtk_rc_parse_string): use gtk_rc_parse_string_with_context.
+
+2002-06-07 Mark McLoughlin <mark skynet ie>
+
+ * gtk/gtkwindow.c: (gtk_window_compute_configure_request): use
+ the RootWindow of this screen for gdk_window_get_pointer.
+
Wed Jun 5 18:34:47 2002 Owen Taylor <otaylor redhat com>
Changes multihead reorganizing code for win32 support,
Index: gtk/gtkrc.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkrc.c,v
retrieving revision 1.124
diff -u -p -r1.124 gtkrc.c
--- gtk/gtkrc.c 28 May 2002 22:23:35 -0000 1.124
+++ gtk/gtkrc.c 6 Jun 2002 04:43:11 -0000
@@ -657,16 +657,13 @@ _gtk_rc_init (void)
"\n"
"widget \"gtk-tooltips*\" style : gtk \"gtk-default-tooltips-style\"\n");
}
-
+
void
-gtk_rc_parse_string (const gchar *rc_string)
+gtk_rc_parse_string_with_context (GtkRcContext *context,
+ const gchar *rc_string)
{
GtkRcFile *rc_file;
- /* This is wrong; once we have meaningful multiple RC contexts, we need to parse the
- * string in all contexts, and in fact, in future contexts as well.
- */
- GtkRcContext *context = gtk_rc_context_get (gtk_settings_get_default ());
-
+
g_return_if_fail (rc_string != NULL);
rc_file = g_new (GtkRcFile, 1);
@@ -679,6 +676,19 @@ gtk_rc_parse_string (const gchar *rc_str
context->rc_files = g_slist_append (context->rc_files, rc_file);
gtk_rc_parse_any (context, "-", -1, rc_string);
+}
+
+
+
+void
+gtk_rc_parse_string (const gchar *rc_string)
+{
+ /* This is wrong; once we have meaningful multiple RC contexts, we need to parse the
+ * string in all contexts, and in fact, in future contexts as well.
+ */
+ GtkRcContext *context = gtk_rc_context_get (gtk_settings_get_default ());
+
+ gtk_rc_parse_string_with_context (context, rc_string);
}
static void
Index: gtk/gtkrc.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkrc.h,v
retrieving revision 1.37
diff -u -p -r1.37 gtkrc.h
--- gtk/gtkrc.h 3 Mar 2002 22:55:58 -0000 1.37
+++ gtk/gtkrc.h 6 Jun 2002 04:43:12 -0000
@@ -142,6 +142,9 @@ void gtk_rc_parse (const gchar *file
void gtk_rc_parse_string (const gchar *rc_string);
gboolean gtk_rc_reparse_all (void);
+void gtk_rc_parse_string_with_context (GtkRcContext *context,
+ const gchar *rc_string);
+
#ifndef GTK_DISABLE_DEPRECATED
void gtk_rc_add_widget_name_style (GtkRcStyle *rc_style,
const gchar *pattern);
Index: gtk/gtkwindow.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkwindow.c,v
retrieving revision 1.209
diff -u -p -r1.209 gtkwindow.c
--- gtk/gtkwindow.c 28 May 2002 22:23:34 -0000 1.209
+++ gtk/gtkwindow.c 6 Jun 2002 04:43:17 -0000
@@ -4161,7 +4161,8 @@ gtk_window_compute_configure_request (Gt
gint screen_height = gdk_screen_get_height (window->screen);
int px, py;
- gdk_window_get_pointer (NULL, &px, &py, NULL);
+ gdk_window_get_pointer (gdk_screen_get_root_window (window->screen),
+ &px, &py, NULL);
x = px - w / 2;
y = py - h / 2;
x = CLAMP (x, 0, screen_width - w);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]