forked from AuroraMiddleware/gtk
Add a check for the Xrandr extension.
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
This commit is contained in:
parent
85d726f9aa
commit
8555f42715
12
ChangeLog
12
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]
|
||||
|
@ -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]
|
||||
|
@ -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]
|
||||
|
@ -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]
|
||||
|
@ -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]
|
||||
|
@ -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]
|
||||
|
15
configure.in
15
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)
|
||||
|
@ -248,3 +248,10 @@ when GDK gets multihead support.
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### SIGNAL GdkScreen::size-changed ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@gdkscreen: the object which received the signal.
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -48,6 +48,8 @@ struct _GdkScreen
|
||||
struct _GdkScreenClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
void (*size_changed) (GdkScreen *screen);
|
||||
};
|
||||
|
||||
GType gdk_screen_get_type (void);
|
||||
|
@ -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) &&
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user