summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog12
-rw-r--r--ChangeLog.pre-2-1012
-rw-r--r--ChangeLog.pre-2-212
-rw-r--r--ChangeLog.pre-2-412
-rw-r--r--ChangeLog.pre-2-612
-rw-r--r--ChangeLog.pre-2-812
-rw-r--r--configure.in15
-rw-r--r--docs/reference/gdk/tmpl/gdkscreen.sgml7
-rw-r--r--gdk/gdkscreen.c26
-rw-r--r--gdk/gdkscreen.h2
-rw-r--r--gdk/x11/gdkevents-x11.c3
-rw-r--r--gdk/x11/gdkscreen-x11.c39
-rw-r--r--gdk/x11/gdkscreen-x11.h2
-rw-r--r--gtk/gtkimcontextsimple.c6
14 files changed, 168 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index d8d63ead1..c7858fc59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Fri Oct 4 11:43:47 2002 Owen Taylor <otaylor@redhat.com>
+
+ * configure.in: Add a check for the Xrandr extension.
+
+ * gdk/gdkscreen.[ch]: Add a size-changed signal.
+
+ * gdk/x11/gdkscreen-x11.[ch]: Patch from Keith packard
+ to hook up ConfigureNotify events on the root window
+ to the ::size-changed signal. (#94560)
+
+ * gtk/gtkimcontextsimple.c: Warning fixes
+
Fri Oct 4 00:57:53 2002 Manish Singh <yosh@gimp.org>
* gtkhscrollbar.[ch] gtkhseparator.[ch] gtkrange.[ch]
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index d8d63ead1..c7858fc59 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,15 @@
+Fri Oct 4 11:43:47 2002 Owen Taylor <otaylor@redhat.com>
+
+ * configure.in: Add a check for the Xrandr extension.
+
+ * gdk/gdkscreen.[ch]: Add a size-changed signal.
+
+ * gdk/x11/gdkscreen-x11.[ch]: Patch from Keith packard
+ to hook up ConfigureNotify events on the root window
+ to the ::size-changed signal. (#94560)
+
+ * gtk/gtkimcontextsimple.c: Warning fixes
+
Fri Oct 4 00:57:53 2002 Manish Singh <yosh@gimp.org>
* gtkhscrollbar.[ch] gtkhseparator.[ch] gtkrange.[ch]
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index d8d63ead1..c7858fc59 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,15 @@
+Fri Oct 4 11:43:47 2002 Owen Taylor <otaylor@redhat.com>
+
+ * configure.in: Add a check for the Xrandr extension.
+
+ * gdk/gdkscreen.[ch]: Add a size-changed signal.
+
+ * gdk/x11/gdkscreen-x11.[ch]: Patch from Keith packard
+ to hook up ConfigureNotify events on the root window
+ to the ::size-changed signal. (#94560)
+
+ * gtk/gtkimcontextsimple.c: Warning fixes
+
Fri Oct 4 00:57:53 2002 Manish Singh <yosh@gimp.org>
* gtkhscrollbar.[ch] gtkhseparator.[ch] gtkrange.[ch]
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index d8d63ead1..c7858fc59 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,15 @@
+Fri Oct 4 11:43:47 2002 Owen Taylor <otaylor@redhat.com>
+
+ * configure.in: Add a check for the Xrandr extension.
+
+ * gdk/gdkscreen.[ch]: Add a size-changed signal.
+
+ * gdk/x11/gdkscreen-x11.[ch]: Patch from Keith packard
+ to hook up ConfigureNotify events on the root window
+ to the ::size-changed signal. (#94560)
+
+ * gtk/gtkimcontextsimple.c: Warning fixes
+
Fri Oct 4 00:57:53 2002 Manish Singh <yosh@gimp.org>
* gtkhscrollbar.[ch] gtkhseparator.[ch] gtkrange.[ch]
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index d8d63ead1..c7858fc59 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,15 @@
+Fri Oct 4 11:43:47 2002 Owen Taylor <otaylor@redhat.com>
+
+ * configure.in: Add a check for the Xrandr extension.
+
+ * gdk/gdkscreen.[ch]: Add a size-changed signal.
+
+ * gdk/x11/gdkscreen-x11.[ch]: Patch from Keith packard
+ to hook up ConfigureNotify events on the root window
+ to the ::size-changed signal. (#94560)
+
+ * gtk/gtkimcontextsimple.c: Warning fixes
+
Fri Oct 4 00:57:53 2002 Manish Singh <yosh@gimp.org>
* gtkhscrollbar.[ch] gtkhseparator.[ch] gtkrange.[ch]
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index d8d63ead1..c7858fc59 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,15 @@
+Fri Oct 4 11:43:47 2002 Owen Taylor <otaylor@redhat.com>
+
+ * configure.in: Add a check for the Xrandr extension.
+
+ * gdk/gdkscreen.[ch]: Add a size-changed signal.
+
+ * gdk/x11/gdkscreen-x11.[ch]: Patch from Keith packard
+ to hook up ConfigureNotify events on the root window
+ to the ::size-changed signal. (#94560)
+
+ * gtk/gtkimcontextsimple.c: Warning fixes
+
Fri Oct 4 00:57:53 2002 Manish Singh <yosh@gimp.org>
* gtkhscrollbar.[ch] gtkhseparator.[ch] gtkrange.[ch]
diff --git a/configure.in b/configure.in
index d7fba08f5..ab6a3a547 100644
--- a/configure.in
+++ b/configure.in
@@ -1177,6 +1177,21 @@ if test "x$gdktarget" = "xx11"; then
AM_CONDITIONAL(XINPUT_XFREE, test x$with_xinput = xxfree)
+ # Check for the RANDR extension
+
+ AC_CHECK_LIB(Xrandr, XRRUpdateConfiguration,
+ [AC_CHECK_HEADER(X11/extensions/Xrandr.h,
+ # RANDR requires RENDER
+ if test -z "`echo $x_extra_libs $x_libs | grep "\-lXrender" 2> /dev/null`"; then
+ x_extra_libs="-lXrender $x_extra_libs"
+ fi
+ x_extra_libs="-lXrandr $x_extra_libs"
+ AC_DEFINE(HAVE_RANDR, 1, Have the Xrandr extension library))],
+ :,
+ $X_LIBS -lXrandr -lXrender -lX11 $X_EXTRA_LIBS)
+
+ # Xshm checks
+
if test "x$enable_shm" = "xyes"; then
# Check for shared memory
AC_CHECK_HEADER(sys/ipc.h, AC_DEFINE(HAVE_IPC_H), no_sys_ipc=yes)
diff --git a/docs/reference/gdk/tmpl/gdkscreen.sgml b/docs/reference/gdk/tmpl/gdkscreen.sgml
index 8b2ac7b45..689681138 100644
--- a/docs/reference/gdk/tmpl/gdkscreen.sgml
+++ b/docs/reference/gdk/tmpl/gdkscreen.sgml
@@ -248,3 +248,10 @@ when GDK gets multihead support.
@Returns:
+<!-- ##### SIGNAL GdkScreen::size-changed ##### -->
+<para>
+
+</para>
+
+@gdkscreen: the object which received the signal.
+
diff --git a/gdk/gdkscreen.c b/gdk/gdkscreen.c
index e822d6466..12cd13fb5 100644
--- a/gdk/gdkscreen.c
+++ b/gdk/gdkscreen.c
@@ -27,6 +27,16 @@
#include "gdkwindow.h"
#include "gdkscreen.h"
+static void gdk_screen_class_init (GdkScreenClass *klass);
+
+enum
+{
+ SIZE_CHANGED,
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
GType
gdk_screen_get_type (void)
{
@@ -39,7 +49,7 @@ gdk_screen_get_type (void)
sizeof (GdkScreenClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
- NULL, /* class_init */
+ (GClassInitFunc) gdk_screen_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GdkScreen),
@@ -54,6 +64,20 @@ gdk_screen_get_type (void)
return object_type;
}
+void
+gdk_screen_x11_class_init (GdkScreenClass *klass)
+{
+ signals[SIZE_CHANGED] =
+ g_signal_new ("size_changed",
+ G_OBJECT_CLASS_TYPE (klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GdkScreenClass, size_changed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE,
+ 0);
+}
+
void
_gdk_screen_close (GdkScreen *screen)
{
diff --git a/gdk/gdkscreen.h b/gdk/gdkscreen.h
index a31b86121..1308eaeac 100644
--- a/gdk/gdkscreen.h
+++ b/gdk/gdkscreen.h
@@ -48,6 +48,8 @@ struct _GdkScreen
struct _GdkScreenClass
{
GObjectClass parent_class;
+
+ void (*size_changed) (GdkScreen *screen);
};
GType gdk_screen_get_type (void);
diff --git a/gdk/x11/gdkevents-x11.c b/gdk/x11/gdkevents-x11.c
index cd9ec3ead..19fa6c913 100644
--- a/gdk/x11/gdkevents-x11.c
+++ b/gdk/x11/gdkevents-x11.c
@@ -1447,6 +1447,9 @@ gdk_event_translate (GdkDisplay *display,
: xevent->xconfigure.event != xevent->xconfigure.window
? " (discarding substructure)"
: ""));
+ if (window && GDK_WINDOW_TYPE (window) == GDK_WINDOW_ROOT)
+ _gdk_x11_screen_size_changed (screen, xevent);
+
if (window &&
xevent->xconfigure.event == xevent->xconfigure.window &&
!GDK_WINDOW_DESTROYED (window) &&
diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c
index 2f312f577..dc408adee 100644
--- a/gdk/x11/gdkscreen-x11.c
+++ b/gdk/x11/gdkscreen-x11.c
@@ -45,6 +45,7 @@ static void gdk_screen_x11_class_init (GdkScreenX11Class *klass);
static void gdk_screen_x11_dispose (GObject *object);
static void gdk_screen_x11_finalize (GObject *object);
static void init_xinerama_support (GdkScreen *screen);
+static void init_randr_support (GdkScreen *screen);
enum
{
@@ -382,6 +383,7 @@ _gdk_x11_screen_new (GdkDisplay *display,
screen_x11->window_manager_name = g_strdup ("unknown");
init_xinerama_support (screen);
+ init_randr_support (screen);
_gdk_visual_init (screen);
_gdk_windowing_window_init (screen);
@@ -480,6 +482,9 @@ static void
init_xinerama_support (GdkScreen * screen)
{
GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (screen);
+
+ if (screen_x11->monitors)
+ g_free (screen_x11->monitors);
#ifdef HAVE_XINERAMA
int opcode, firstevent, firsterror;
@@ -503,6 +508,40 @@ init_xinerama_support (GdkScreen * screen)
screen_x11->monitors[0].height = HeightOfScreen (screen_x11->xscreen);
}
+static void
+init_randr_support (GdkScreen * screen)
+{
+ GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (screen);
+
+ XSelectInput (GDK_SCREEN_XDISPLAY (screen),
+ screen_x11->xroot_window,
+ StructureNotifyMask);
+}
+
+void
+_gdk_x11_screen_size_changed (GdkScreen *screen,
+ XEvent *event)
+{
+#ifdef HAVE_RANDR
+ if (!XRRUpdateConfiguration (event))
+ return;
+#else
+ if (event->type == ConfigureNotify)
+ {
+ XConfigureEvent *rcevent = (XConfigureEvent *) event;
+ Screen *xscreen = gdk_x11_screen_get_xscreen (screen);
+
+ xscreen->width = rcevent->width;
+ xscreen->height = rcevent->height;
+ }
+ else
+ return;
+#endif
+
+ init_xinerama_support (screen);
+ g_signal_emit_by_name (G_OBJECT (screen), "size_changed");
+}
+
void
_gdk_x11_screen_window_manager_changed (GdkScreen *screen)
{
diff --git a/gdk/x11/gdkscreen-x11.h b/gdk/x11/gdkscreen-x11.h
index 6d3864671..89aa4390d 100644
--- a/gdk/x11/gdkscreen-x11.h
+++ b/gdk/x11/gdkscreen-x11.h
@@ -102,6 +102,8 @@ GdkScreen * _gdk_x11_screen_new (GdkDisplay *display,
gint screen_number);
void _gdk_x11_screen_window_manager_changed (GdkScreen *screen);
+void _gdk_x11_screen_size_changed (GdkScreen *screen,
+ XEvent *event);
G_END_DECLS
diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c
index 99db9d233..6ca2529d7 100644
--- a/gtk/gtkimcontextsimple.c
+++ b/gtk/gtkimcontextsimple.c
@@ -1132,10 +1132,10 @@ no_sequence_matches (GtkIMContextSimple *context_simple,
for (i=0; i < n_compose - len - 1; i++)
{
- GdkEventKey *tmp_event = gdk_event_copy (event);
- tmp_event->keyval = context_simple->compose_buffer[len + i];
+ GdkEvent *tmp_event = gdk_event_copy ((GdkEvent *)event);
+ tmp_event->key.keyval = context_simple->compose_buffer[len + i];
- gtk_im_context_filter_keypress (context, tmp_event);
+ gtk_im_context_filter_keypress (context, (GdkEventKey *)tmp_event);
gdk_event_free (tmp_event);
}