--- a/src/gtkui/gtk_win.c Thu Aug 28 01:39:51 2008 +0000 +++ b/src/gtkui/gtk_win.c Tue Sep 02 03:34:00 2008 +0000 @@ -33,6 +33,7 @@ #include "lxdream.h" #include "dreamcast.h" #include "display.h" +#include "gdrom/gdrom.h" #include "gtkui/gtkui.h" @@ -51,6 +52,13 @@ /******************** Video window **************************/ +#if !(GTK_CHECK_VERSION(2,8,0)) +void gdk_display_warp_pointer (GdkDisplay *display, + GdkScreen *screen, + gint x, + gint y); +#endif + /** * Adjust the mouse pointer so that it appears in the center of the video * window. Mainly used for when we have the mouse grab @@ -125,7 +133,7 @@ if( win->is_grabbed && (x != win->mouse_x || y != win->mouse_y) ) { uint32_t buttons = (event->state >> 8)&0x1F; - input_event_mouse( buttons, x - win->mouse_x, y - win->mouse_y ); + input_event_mouse( buttons, x - win->mouse_x, y - win->mouse_y, FALSE ); video_window_center_pointer(win); } return TRUE; @@ -135,10 +143,12 @@ gpointer user_data ) { main_window_t win = (main_window_t)user_data; + // Get the buttons from the event state, and add the pressed button + uint32_t buttons = ((event->state >> 8) & 0x1F) | (1<<(event->button-1)); if( win->is_grabbed ) { - // Get the buttons from the event state, and remove the released button - uint32_t buttons = ((event->state >> 8) & 0x1F) | (1<<(event->button-1)); - input_event_mouse( buttons, 0, 0 ); + input_event_mouse( buttons, 0, 0, FALSE ); + } else { + input_event_mouse( buttons, (int)event->x, (int)event->y, TRUE ); } return TRUE; } @@ -147,13 +157,15 @@ gpointer user_data ) { main_window_t win = (main_window_t)user_data; + // Get the buttons from the event state, and remove the released button + uint32_t buttons = ((event->state >> 8) & 0x1F) & (~(1<<(event->button-1))); if( win->is_grabbed ) { - // Get the buttons from the event state, and remove the released button - uint32_t buttons = ((event->state >> 8) & 0x1F) & (~(1<<(event->button-1))); - input_event_mouse( buttons, 0, 0 ); + input_event_mouse( buttons, 0, 0, FALSE ); } else if( win->use_grab) { video_window_grab_display(win); - } + } else { + input_event_mouse( buttons, (int)event->x, (int)event->y, TRUE ); + } return TRUE; }