filename | src/gtkui/gtk_win.c |
changeset | 839:51f1c4195790 |
prev | 837:4eae2ddccf9c |
next | 843:7936c1162ce9 |
author | nkeynes |
date | Tue Sep 02 03:34:00 2008 +0000 (15 years ago) |
permissions | -rw-r--r-- |
last change | Implement absolute positioning mouse mode when not grabbed enable/disable grab on dreamcast start/stop where it's requested by the controllers |
file | annotate | diff | log | raw |
1.1 --- a/src/gtkui/gtk_win.c Thu Aug 28 01:39:51 2008 +00001.2 +++ b/src/gtkui/gtk_win.c Tue Sep 02 03:34:00 2008 +00001.3 @@ -33,6 +33,7 @@1.4 #include "lxdream.h"1.5 #include "dreamcast.h"1.6 #include "display.h"1.7 +#include "gdrom/gdrom.h"1.8 #include "gtkui/gtkui.h"1.11 @@ -51,6 +52,13 @@1.13 /******************** Video window **************************/1.15 +#if !(GTK_CHECK_VERSION(2,8,0))1.16 +void gdk_display_warp_pointer (GdkDisplay *display,1.17 + GdkScreen *screen,1.18 + gint x,1.19 + gint y);1.20 +#endif1.21 +1.22 /**1.23 * Adjust the mouse pointer so that it appears in the center of the video1.24 * window. Mainly used for when we have the mouse grab1.25 @@ -125,7 +133,7 @@1.26 if( win->is_grabbed &&1.27 (x != win->mouse_x || y != win->mouse_y) ) {1.28 uint32_t buttons = (event->state >> 8)&0x1F;1.29 - input_event_mouse( buttons, x - win->mouse_x, y - win->mouse_y );1.30 + input_event_mouse( buttons, x - win->mouse_x, y - win->mouse_y, FALSE );1.31 video_window_center_pointer(win);1.32 }1.33 return TRUE;1.34 @@ -135,10 +143,12 @@1.35 gpointer user_data )1.36 {1.37 main_window_t win = (main_window_t)user_data;1.38 + // Get the buttons from the event state, and add the pressed button1.39 + uint32_t buttons = ((event->state >> 8) & 0x1F) | (1<<(event->button-1));1.40 if( win->is_grabbed ) {1.41 - // Get the buttons from the event state, and remove the released button1.42 - uint32_t buttons = ((event->state >> 8) & 0x1F) | (1<<(event->button-1));1.43 - input_event_mouse( buttons, 0, 0 );1.44 + input_event_mouse( buttons, 0, 0, FALSE );1.45 + } else {1.46 + input_event_mouse( buttons, (int)event->x, (int)event->y, TRUE );1.47 }1.48 return TRUE;1.49 }1.50 @@ -147,13 +157,15 @@1.51 gpointer user_data )1.52 {1.53 main_window_t win = (main_window_t)user_data;1.54 + // Get the buttons from the event state, and remove the released button1.55 + uint32_t buttons = ((event->state >> 8) & 0x1F) & (~(1<<(event->button-1)));1.56 if( win->is_grabbed ) {1.57 - // Get the buttons from the event state, and remove the released button1.58 - uint32_t buttons = ((event->state >> 8) & 0x1F) & (~(1<<(event->button-1)));1.59 - input_event_mouse( buttons, 0, 0 );1.60 + input_event_mouse( buttons, 0, 0, FALSE );1.61 } else if( win->use_grab) {1.62 video_window_grab_display(win);1.63 - }1.64 + } else {1.65 + input_event_mouse( buttons, (int)event->x, (int)event->y, TRUE );1.66 + }1.67 return TRUE;1.68 }
.