Commit 7ddfec4f authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Patch from Eric Warmonhoven to get linux-fb compiling with multihead

Tue Sep 10 11:11:09 2002  Owen Taylor  <otaylor@redhat.com>
        * gdk/linux-fb/*: Patch from Eric Warmonhoven to
        get linux-fb compiling with multihead changes.
parent 44e2b53f
Tue Sep 10 11:11:09 2002 Owen Taylor <otaylor@redhat.com>
* gdk/linux-fb/*: Patch from Eric Warmonhoven to
get linux-fb compiling with multihead changes.
Tue Sep 10 09:29:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Take
......
Tue Sep 10 11:11:09 2002 Owen Taylor <otaylor@redhat.com>
* gdk/linux-fb/*: Patch from Eric Warmonhoven to
get linux-fb compiling with multihead changes.
Tue Sep 10 09:29:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Take
......
Tue Sep 10 11:11:09 2002 Owen Taylor <otaylor@redhat.com>
* gdk/linux-fb/*: Patch from Eric Warmonhoven to
get linux-fb compiling with multihead changes.
Tue Sep 10 09:29:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Take
......
Tue Sep 10 11:11:09 2002 Owen Taylor <otaylor@redhat.com>
* gdk/linux-fb/*: Patch from Eric Warmonhoven to
get linux-fb compiling with multihead changes.
Tue Sep 10 09:29:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Take
......
Tue Sep 10 11:11:09 2002 Owen Taylor <otaylor@redhat.com>
* gdk/linux-fb/*: Patch from Eric Warmonhoven to
get linux-fb compiling with multihead changes.
Tue Sep 10 09:29:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Take
......
Tue Sep 10 11:11:09 2002 Owen Taylor <otaylor@redhat.com>
* gdk/linux-fb/*: Patch from Eric Warmonhoven to
get linux-fb compiling with multihead changes.
Tue Sep 10 09:29:00 2002 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkevents-x11.c (gdk_event_translate): Take
......
......@@ -28,6 +28,7 @@ libgdk_linux_fb_la_SOURCES = \
gdkcolor-fb.c \
gdkcursor-fb.c \
gdkdnd-fb.c \
gdkdisplay-fb.c \
gdkdrawable-fb2.c \
gdkfont-fb.c \
gdkgc-fb.c \
......@@ -40,6 +41,7 @@ libgdk_linux_fb_la_SOURCES = \
gdkpixmap-fb.c \
gdkproperty-fb.c \
gdkselection-fb.c \
gdkscreen-fb.c \
gdkvisual-fb.c \
gdkwindow-fb.c \
gdkprivate-fb.h \
......@@ -73,6 +75,8 @@ libgdk_linux_fb_la_SOURCES = \
gdkfbmanager.h
gdkfbmanager_sources = gdkfbmanager.c
gdkfbmanager_LDFLAGS = $(GLIB_LIBS)
gdkfbswitch_sources = gdkfbswitch.c
gdkfbswitch_LDFLAGS = $(GLIB_LIBS)
EXTRA_DIST=x-cursors.xbm
......@@ -202,7 +202,7 @@ gdk_colormap_new (GdkVisual *visual,
}
GdkColormap*
gdk_colormap_get_system (void)
gdk_screen_get_system_colormap (GdkScreen *screen)
{
static GdkColormap *colormap = NULL;
......@@ -854,3 +854,11 @@ gdk_colormap_query_color (GdkColormap *colormap,
break;
}
}
GdkScreen*
gdk_colormap_get_screen (GdkColormap *cmap)
{
g_return_val_if_fail (cmap != NULL, NULL);
return gdk_screen_get_default ();
}
......@@ -192,7 +192,8 @@ static struct {
};
GdkCursor*
gdk_cursor_new (GdkCursorType cursor_type)
gdk_cursor_new_for_display (GdkDisplay *display,
GdkCursorType cursor_type)
{
GdkCursor *cursor;
......@@ -528,3 +529,9 @@ gdk_fb_cursor_reset(void)
gdk_fb_mouse_get_info (&x, &y, NULL);
gdk_fb_cursor_move (x, y, win);
}
GdkDisplay *
gdk_cursor_get_display (GdkCursor *cursor)
{
return gdk_display_get_default ();
}
/* GDK - The GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "gdk.h"
#include "gdkprivate-fb.h"
GdkDisplay *
gdk_display_open (const gchar *display_name)
{
if (_gdk_display != NULL)
return NULL; /* single display only */
_gdk_display = g_object_new (GDK_TYPE_DISPLAY, NULL);
_gdk_screen = g_object_new (GDK_TYPE_SCREEN, NULL);
_gdk_visual_init ();
gdk_screen_set_default_colormap (_gdk_screen,
gdk_screen_get_system_colormap (_gdk_screen));
_gdk_windowing_window_init ();
_gdk_windowing_image_init ();
_gdk_events_init ();
_gdk_input_init ();
_gdk_dnd_init ();
g_signal_emit_by_name (gdk_display_manager_get (),
"display_opened", _gdk_display);
return _gdk_display;
}
G_CONST_RETURN gchar *
gdk_display_get_name (GdkDisplay *display)
{
return gdk_get_display_arg_name ();
}
int
gdk_display_get_n_screens (GdkDisplay *display)
{
return 1;
}
GdkScreen *
gdk_display_get_screen (GdkDisplay *display,
gint screen_num)
{
return _gdk_screen;
}
GdkScreen *
gdk_display_get_default_screen (GdkDisplay *display)
{
return _gdk_screen;
}
......@@ -86,6 +86,7 @@ static GdkColormap* gdk_fb_get_colormap (GdkDrawable *drawable);
static void gdk_fb_set_colormap (GdkDrawable *drawable,
GdkColormap *colormap);
static gint gdk_fb_get_depth (GdkDrawable *drawable);
static GdkScreen* gdk_fb_get_screen (GdkDrawable *drawable);
static GdkVisual* gdk_fb_get_visual (GdkDrawable *drawable);
static void gdk_fb_drawable_finalize (GObject *object);
......@@ -219,6 +220,7 @@ gdk_drawable_impl_fb_class_init (GdkDrawableFBClass *klass)
drawable_class->get_size = gdk_fb_get_size;
drawable_class->get_depth = gdk_fb_get_depth;
drawable_class->get_screen = gdk_fb_get_screen;
drawable_class->get_visual = gdk_fb_get_visual;
drawable_class->_copy_to_image = _gdk_fb_copy_to_image;
......@@ -1305,6 +1307,12 @@ gdk_fb_get_depth (GdkDrawable *drawable)
return GDK_DRAWABLE_FBDATA (drawable)->depth;
}
static GdkScreen*
gdk_fb_get_screen (GdkDrawable *drawable)
{
return gdk_screen_get_default();
}
static GdkVisual*
gdk_fb_get_visual (GdkDrawable *drawable)
{
......
......@@ -87,16 +87,17 @@ _gdk_events_init (void)
gboolean
gdk_events_pending (void)
{
return _gdk_event_queue_find_first () ? TRUE : FALSE;
return fb_events_check (NULL);
}
GdkEvent*
gdk_event_get_graphics_expose (GdkWindow *window)
{
GdkDisplay *display = gdk_display_get_default ();
GList *ltmp;
g_return_val_if_fail (window != NULL, NULL);
for (ltmp = _gdk_queued_events; ltmp; ltmp = ltmp->next)
for (ltmp = display->queued_events; ltmp; ltmp = ltmp->next)
{
GdkEvent *event = ltmp->data;
if (event->type == GDK_EXPOSE &&
......@@ -108,7 +109,7 @@ gdk_event_get_graphics_expose (GdkWindow *window)
{
GdkEvent *retval = ltmp->data;
_gdk_event_queue_remove_link (ltmp);
_gdk_event_queue_remove_link (display, ltmp);
g_list_free_1 (ltmp);
return retval;
......@@ -118,7 +119,7 @@ gdk_event_get_graphics_expose (GdkWindow *window)
}
void
_gdk_events_queue (void)
_gdk_events_queue (GdkDisplay *display)
{
}
......@@ -138,7 +139,7 @@ fb_events_check (GSource *source)
GDK_THREADS_ENTER ();
retval = (_gdk_event_queue_find_first () != NULL);
retval = (_gdk_event_queue_find_first (gdk_display_get_default ()) != NULL);
GDK_THREADS_LEAVE ();
......@@ -154,7 +155,7 @@ fb_events_dispatch (GSource *source,
GDK_THREADS_ENTER ();
while ((event = _gdk_event_unqueue ()))
while ((event = _gdk_event_unqueue (gdk_display_get_default ())))
{
if (event->type == GDK_EXPOSE &&
event->expose.window == _gdk_parent_root)
......@@ -199,19 +200,28 @@ gdk_flush (void)
}
gboolean
gdk_event_send_client_message (GdkEvent *event, guint32 xid)
gdk_event_send_client_message_for_display (GdkDisplay *display,
GdkEvent *event,
guint32 xid)
{
return FALSE;
}
void
gdk_event_send_clientmessage_toall (GdkEvent *sev)
gdk_screen_broadcast_client_message (GdkScreen *screen,
GdkEvent *sev)
{
}
gboolean
gdk_setting_get (const gchar *name,
GValue *value)
gdk_screen_get_setting (GdkScreen *screen,
const gchar *name,
GValue *value)
{
return FALSE;
}
void
gdk_display_sync (GdkDisplay *display)
{
}
......@@ -87,7 +87,8 @@ gdk_font_hash_lookup (GdkFontType type, const gchar *font_name)
}
GdkFont*
gdk_font_from_description (PangoFontDescription *desc)
gdk_font_from_description_for_display (GdkDisplay *display,
PangoFontDescription *desc)
{
GdkFont *font;
GdkFontPrivateFB *private;
......@@ -154,7 +155,8 @@ gdk_font_from_description (PangoFontDescription *desc)
GdkFont*
gdk_font_load (const gchar *font_name)
gdk_font_load_for_display (GdkDisplay *display,
const gchar *font_name)
{
GdkFont *font;
GdkFontPrivateFB *private;
......
......@@ -35,6 +35,10 @@ gboolean _gdk_fb_pointer_grab_owner_events;
gboolean _gdk_fb_keyboard_grab_owner_events;
GdkEventMask _gdk_fb_pointer_grab_events, _gdk_fb_keyboard_grab_events;
GdkDisplay *_gdk_display = NULL;
GdkScreen *_gdk_screen = NULL;
GdkWindow *_gdk_parent_root = NULL;
GdkFBWindow *gdk_root_window = NULL;
GdkFBDisplay *gdk_display = NULL;
GdkCursor *_gdk_fb_pointer_grab_cursor;
......
......@@ -105,7 +105,8 @@ gdk_image_get_type (void)
GdkImage*
_gdk_image_new_for_depth (GdkImageType type,
_gdk_image_new_for_depth (GdkScreen *screen,
GdkImageType type,
GdkVisual *visual,
gint width,
gint height,
......@@ -170,15 +171,6 @@ gdk_image_new_bitmap(GdkVisual *visual,
return image;
}
GdkImage*
gdk_image_new (GdkImageType type,
GdkVisual *visual,
gint width,
gint height)
{
return _gdk_image_new_for_depth (type, visual, width, height, -1);
}
GdkImage*
_gdk_fb_copy_to_image (GdkDrawable *drawable,
GdkImage *image,
......@@ -343,7 +335,8 @@ _gdk_image_exit(void)
/* copy/pasted from gdkimage-win32.c */
gint
_gdk_windowing_get_bits_for_depth (gint depth)
_gdk_windowing_get_bits_for_depth (GdkDisplay *display,
gint depth)
{
if ((1 == depth) || (8 == depth) || (16 == depth) ||
(24 == depth) || (32 == depth))
......
......@@ -126,6 +126,7 @@ struct _GdkInputWindow
/* Global data */
extern const GdkDevice gdk_input_core_info;
extern GdkDevice *_gdk_core_pointer;
extern GList *_gdk_input_devices;
extern GList *_gdk_input_windows;
......
......@@ -147,7 +147,7 @@ static GdkFBKeyboardDevice keyb_devs[] =
};
GdkKeymap*
gdk_keymap_get_default (void)
gdk_keymap_get_default_for_display (GdkDisplay *display)
{
if (default_keymap == NULL)
default_keymap = g_object_new (gdk_keymap_get_type (), NULL);
......@@ -155,6 +155,12 @@ gdk_keymap_get_default (void)
return default_keymap;
}
GdkKeymap*
gdk_keymap_get_for_display (GdkDisplay *display)
{
return gdk_keymap_get_default_for_display (display);
}
PangoDirection
gdk_keymap_get_direction (GdkKeymap *keymap)
{
......@@ -873,8 +879,8 @@ xlate_io (GIOChannel *gioc,
}
static gboolean
write_string (gint fd,
gchar *str)
write_string (gint fd,
const gchar *str)
{
gsize to_write = strlen (str);
......@@ -972,8 +978,8 @@ xlate_get_for_keyval (GdkFBKeyboard *kb,
gint *n_keys)
{
g_warning ("xlate_get_for_keyval() NIY");
*keys=NULL;
*n_keys=0;
if (keys) *keys=NULL;
if (n_keys) *n_keys=0;
return FALSE;
}
......@@ -985,8 +991,8 @@ xlate_get_for_keycode (GdkFBKeyboard *kb,
gint *n_entries)
{
g_warning ("xlate_get_for_keycode() NIY");
*keys=NULL;
*n_entries=0;
if (keys) *keys=NULL;
if (n_entries) *n_entries=0;
return FALSE;
}
......@@ -1487,8 +1493,8 @@ raw_get_for_keyval (GdkFBKeyboard *kb,
gint *n_keys)
{
g_warning ("raw_get_for_keyval() NIY");
*keys=NULL;
*n_keys=0;
if (keys) *keys=NULL;
if (n_keys) *n_keys=0;
return FALSE;
}
......@@ -1500,7 +1506,7 @@ raw_get_for_keycode (GdkFBKeyboard *kb,
gint *n_entries)
{
g_warning ("raw_get_for_keycode() NIY");
*keys=NULL;
*n_entries=0;
if (keys) *keys=NULL;
if (n_entries) *n_entries=0;
return FALSE;
}
......@@ -799,11 +799,11 @@ gdk_fb_display_destroy (GdkFBDisplay *display)
g_free (display);
}
gboolean
_gdk_windowing_init_check (int argc, char **argv)
void
_gdk_windowing_init (int *argc, char ***argv)
{
if (gdk_initialized)
return TRUE;
return;
/* Create new session and become session leader */
setsid();
......@@ -811,7 +811,7 @@ _gdk_windowing_init_check (int argc, char **argv)
gdk_display = gdk_fb_display_new ();
if (!gdk_display)
return FALSE;
return;
gdk_shadow_fb_init ();
......@@ -822,7 +822,7 @@ _gdk_windowing_init_check (int argc, char **argv)
g_warning ("Failed to initialize keyboard");
gdk_fb_display_destroy (gdk_display);
gdk_display = NULL;
return FALSE;
return;
}
if (!gdk_fb_mouse_init (!gdk_display->manager_blocked))
......@@ -831,15 +831,18 @@ _gdk_windowing_init_check (int argc, char **argv)
gdk_fb_keyboard_close ();
gdk_fb_display_destroy (gdk_display);
gdk_display = NULL;
return FALSE;
return;
}
gdk_initialized = TRUE;
_gdk_selection_property = gdk_atom_intern ("GDK_SELECTION", FALSE);
return TRUE;
}
void
_gdk_windowing_set_default_display (GdkDisplay *display)
{
}
/*
......@@ -933,7 +936,7 @@ gdk_fb_pointer_grab (GdkWindow * window,
/*
*--------------------------------------------------------------
* gdk_pointer_ungrab
* gdk_display_pointer_ungrab
*
* Releases any pointer grab
*
......@@ -947,7 +950,8 @@ gdk_fb_pointer_grab (GdkWindow * window,
*/
void
gdk_pointer_ungrab (guint32 time)
gdk_display_pointer_ungrab (GdkDisplay *display,
guint32 time)
{
gdk_fb_pointer_ungrab (time, FALSE);
}
......@@ -993,7 +997,7 @@ gdk_fb_pointer_ungrab (guint32 time, gboolean implicit_grab)
/*
*--------------------------------------------------------------
* gdk_pointer_is_grabbed
* gdk_display_pointer_is_grabbed
*
* Tell wether there is an active x pointer grab in effect
*
......@@ -1007,7 +1011,7 @@ gdk_fb_pointer_ungrab (guint32 time, gboolean implicit_grab)
*/
gint
gdk_pointer_is_grabbed (void)
gdk_display_pointer_is_grabbed (GdkDisplay *display)
{
return _gdk_fb_pointer_grab_window != NULL;
}
......@@ -1033,9 +1037,9 @@ gdk_pointer_is_grabbed (void)
*/
GdkGrabStatus
gdk_keyboard_grab (GdkWindow * window,
gint owner_events,
guint32 time)
gdk_keyboard_grab (GdkWindow *window,
gint owner_events,
guint32 time)
{
g_return_val_if_fail (window != NULL, 0);
g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
......@@ -1051,7 +1055,7 @@ gdk_keyboard_grab (GdkWindow * window,
/*
*--------------------------------------------------------------
* gdk_keyboard_ungrab
* gdk_display_keyboard_ungrab
*
* Releases any keyboard grab
*
......@@ -1065,7 +1069,8 @@ gdk_keyboard_grab (GdkWindow * window,
*/
void
gdk_keyboard_ungrab (guint32 time)
gdk_display_keyboard_ungrab (GdkDisplay *display,
guint32 time)
{
if (_gdk_fb_keyboard_grab_window)
gdk_window_unref (_gdk_fb_keyboard_grab_window);
......@@ -1073,7 +1078,8 @@ gdk_keyboard_ungrab (guint32 time)
}
gboolean
gdk_pointer_grab_info_libgtk_only (GdkWindow **grab_window,
gdk_pointer_grab_info_libgtk_only (GdkDisplay *display,
GdkWindow **grab_window,
gboolean *owner_events)
{
if (_gdk_fb_pointer_grab_window)
......@@ -1090,8 +1096,9 @@ gdk_pointer_grab_info_libgtk_only (GdkWindow **grab_window,
}
gboolean
gdk_keyboard_grab_info_libgtk_only (GdkWindow **grab_window,
gboolean *owner_events)
gdk_keyboard_grab_info_libgtk_only (GdkDisplay *display,
GdkWindow **grab_window,
gboolean *owner_events)
{
if (_gdk_fb_keyboard_grab_window)
{
......@@ -1109,7 +1116,7 @@ gdk_keyboard_grab_info_libgtk_only (GdkWindow **grab_window,
/*
*--------------------------------------------------------------
* gdk_screen_width
* gdk_screen_get_width
*
* Return the width of the screen.
*
......@@ -1123,14 +1130,14 @@ gdk_keyboard_grab_info_libgtk_only (GdkWindow **grab_window,
*/
gint
gdk_screen_width (void)
gdk_screen_get_width (GdkScreen *screen)
{
return gdk_display->fb_width;
}
/*
*--------------------------------------------------------------
* gdk_screen_height
* gdk_screen_get_height
*
* Return the height of the screen.
*
......@@ -1144,14 +1151,14 @@ gdk_screen_width (void)
*/
gint
gdk_screen_height (void)
gdk_screen_get_height (GdkScreen *screen)
{
return gdk_display->fb_height;
}
/*
*--------------------------------------------------------------
* gdk_screen_width_mm
* gdk_screen_get_width_mm
*
* Return the width of the screen in millimeters.
*
......@@ -1165,14 +1172,14 @@ gdk_screen_height (void)
*/
gint
gdk_screen_width_mm (void)
gdk_screen_get_width_mm (GdkScreen *screen)
{
return 0.5 + gdk_screen_width () * (25.4 / 72.);
}
/*
*--------------------------------------------------------------
* gdk_screen_height
* gdk_screen_get_height_mm
*
* Return the height of the screen in millimeters.
*
......@@ -1186,14 +1193,14 @@ gdk_screen_width_mm (void)
*/
gint
gdk_screen_height_mm (void)
gdk_screen_get_height_mm (GdkScreen *screen)
{
return 0.5 + gdk_screen_height () * (25.4 / 72.);
}
/*
*--------------------------------------------------------------
* gdk_set_sm_client_id
* gdk_display_set_sm_client_id
*
* Set the SM_CLIENT_ID property on the WM_CLIENT_LEADER window
* so that the window manager can save our state using the
......@@ -1214,11 +1221,11 @@ gdk_screen_height_mm (void)
*/
void
gdk_set_sm_client_id (const gchar* sm_client_id)
gdk_display_set_sm_client_id (GdkDisplay* display,
const gchar* sm_client_id)
{
}
extern void keyboard_shutdown(void);
void
......@@ -1260,9 +1267,8 @@ gdk_get_display(void)
return g_strdup (s);
}
void
gdk_beep (void)
gdk_display_beep (GdkDisplay *display)
{
static int pitch = 600, duration = 100;
gulong arg;
......@@ -1326,7 +1332,7 @@ gdk_fb_other_event_window (GdkWindow *window,
(g_object_get_data (G_OBJECT (w), "gdk-window-child-handler")))
break;
evmask = GDK_WINDOW_IMPL_FBDATA(window)->event_mask;
evmask = GDK_WINDOW_OBJECT(window)->event_mask;
if (evmask & type_masks[type])
return w;
......@@ -1375,7 +1381,7 @@ gdk_fb_pointer_event_window (GdkWindow *window,
(g_object_get_data (G_OBJECT (w), "gdk-window-child-handler")))
break;
evmask = GDK_WINDOW_IMPL_FBDATA(window)->event_mask;
evmask = GDK_WINDOW_OBJECT(window)->event_mask;
if (evmask & (GDK_BUTTON1_MOTION_MASK | GDK_BUTTON2_MOTION_MASK | GDK_BUTTON3_MOTION_MASK))
{
......@@ -1433,7 +1439,7 @@ gdk_fb_keyboard_event_window (GdkWindow *window,
(g_object_get_data (G_OBJECT (w), "gdk-window-child-handler")))
break;
evmask = GDK_WINDOW_IMPL_FBDATA(window)->event_mask;
evmask = GDK_WINDOW_OBJECT(window)->event_mask;
if (evmask & type_masks[type])
return w;
......@@ -1523,7 +1529,7 @@ gdk_event_make (GdkWindow *window,
}
if (append_to_queue)
_gdk_event_queue_append (event);
_gdk_event_queue_append (gdk_display_get_default (), event);
return event;
}
......
......@@ -20,6 +20,7 @@
#include <gdk/gdk.h>
#include <gdk/gdkinternals.h>
#include "gdkprivate-fb.h"
#include "gdkinputprivate.h"
#include <stdlib.h>
#include <sys/types.h>
#include <fcntl.h>
......@@ -183,11 +184,11 @@ send_button_event (GdkFBMouse *mouse,
event->button.x_root = mouse->x;
event->button.y_root = mouse->y;
_gdk_event_queue_append (event);
_gdk_event_queue_append (gdk_display_get_default (), event);
/* For double-clicks */
if (press_event)
_gdk_event_button_generate (event);
_gdk_event_button_generate (gdk_display_get_default (), event);
}