4 * Copyright 1993 Alexandre Julliard
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #define COM_NO_WINDOWS_H
25 #include <X11/Xatom.h>
26 #include <X11/keysym.h>
28 #include <X11/Xresource.h>
29 #include <X11/Xutil.h>
30 #ifdef HAVE_LIBXXF86DGA2
31 #include <X11/extensions/xf86dga.h>
37 #include "wine/winuser16.h"
42 #include "shlobj.h" /* DROPFILES */
48 #include "wine/debug.h"
50 WINE_DEFAULT_DEBUG_CHANNEL(event);
51 WINE_DECLARE_DEBUG_CHANNEL(clipboard);
53 extern BOOL ximInComposeMode;
55 #define DndNotDnd -1 /* OffiX drag&drop */
67 #define DndURL 128 /* KDE drag&drop */
69 static const char * const event_names[] =
71 "", "", "KeyPress", "KeyRelease", "ButtonPress", "ButtonRelease",
72 "MotionNotify", "EnterNotify", "LeaveNotify", "FocusIn", "FocusOut",
73 "KeymapNotify", "Expose", "GraphicsExpose", "NoExpose", "VisibilityNotify",
74 "CreateNotify", "DestroyNotify", "UnmapNotify", "MapNotify", "MapRequest",
75 "ReparentNotify", "ConfigureNotify", "ConfigureRequest", "GravityNotify",
76 "ResizeRequest", "CirculateNotify", "CirculateRequest", "PropertyNotify",
77 "SelectionClear", "SelectionRequest", "SelectionNotify", "ColormapNotify",
78 "ClientMessage", "MappingNotify"
82 static void EVENT_ProcessEvent( XEvent *event );
85 static void EVENT_FocusIn( HWND hWnd, XFocusChangeEvent *event );
86 static void EVENT_FocusOut( HWND hWnd, XFocusChangeEvent *event );
87 static void EVENT_PropertyNotify( XPropertyEvent *event );
88 static void EVENT_ClientMessage( HWND hWnd, XClientMessageEvent *event );
90 #ifdef HAVE_LIBXXF86DGA2
91 static int DGAMotionEventType;
92 static int DGAButtonPressEventType;
93 static int DGAButtonReleaseEventType;
94 static int DGAKeyPressEventType;
95 static int DGAKeyReleaseEventType;
97 static BOOL DGAUsed = FALSE;
98 static HWND DGAhwnd = 0;
101 /* Static used for the current input method */
102 static INPUT_TYPE current_input_type = X11DRV_INPUT_ABSOLUTE;
103 static BOOL in_transition = FALSE; /* This is not used as for today */
106 /***********************************************************************
109 static int process_events( struct x11drv_thread_data *data )
115 while ( XPending( data->display ) )
119 XNextEvent( data->display, &event );
120 ignore = XFilterEvent( &event, None );
122 if (!ignore) EVENT_ProcessEvent( &event );
131 /***********************************************************************
132 * MsgWaitForMultipleObjectsEx (X11DRV.@)
134 DWORD X11DRV_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles,
135 DWORD timeout, DWORD mask, DWORD flags )
137 HANDLE new_handles[MAXIMUM_WAIT_OBJECTS+1]; /* FIXME! */
139 struct x11drv_thread_data *data = NtCurrentTeb()->driver_data;
141 if (!data || data->process_event_count)
142 return WaitForMultipleObjectsEx( count, handles, flags & MWMO_WAITALL,
143 timeout, flags & MWMO_ALERTABLE );
145 /* check whether only server queue handle was passed in */
146 if (count < 2) flags &= ~MWMO_WAITALL;
148 for (i = 0; i < count; i++) new_handles[i] = handles[i];
149 new_handles[count] = data->display_fd;
152 XFlush( gdi_display );
153 XFlush( data->display );
156 data->process_event_count++;
157 if (process_events( data )) ret = count;
160 ret = WaitForMultipleObjectsEx( count+1, new_handles, flags & MWMO_WAITALL,
161 timeout, flags & MWMO_ALERTABLE );
162 if (ret == count) process_events( data );
164 data->process_event_count--;
168 /***********************************************************************
169 * EVENT_x11_time_to_win32_time
171 * Make our timer and the X timer line up as best we can
172 * Pass 0 to retrieve the current adjustment value (times -1)
174 DWORD EVENT_x11_time_to_win32_time(Time time)
176 static DWORD adjust = 0;
177 DWORD now = GetTickCount();
180 if (! adjust && time != 0)
187 /* If we got an event in the 'future', then our clock is clearly wrong.
188 If we got it more than 10000 ms in the future, then it's most likely
189 that the clock has wrapped. */
192 if (ret > now && ((ret - now) < 10000) && time != 0)
203 /***********************************************************************
206 * Process an X event.
208 static void EVENT_ProcessEvent( XEvent *event )
211 Display *display = event->xany.display;
213 TRACE( "called.\n" );
217 case SelectionNotify: /* all of these should be caught by XCheckTypedWindowEvent() */
218 FIXME("Got SelectionNotify - must not happen!\n");
221 /* We get all these because of StructureNotifyMask.
222 This check is placed here to avoid getting error messages below,
223 as X might send some of these even for windows that have already
225 case CirculateNotify:
233 #ifdef HAVE_LIBXXF86DGA2
235 if (event->type == DGAMotionEventType) {
236 TRACE("DGAMotionEvent received.\n");
237 X11DRV_DGAMotionEvent( DGAhwnd, (XDGAMotionEvent *)event );
240 if (event->type == DGAButtonPressEventType) {
241 TRACE("DGAButtonPressEvent received.\n");
242 X11DRV_DGAButtonPressEvent( DGAhwnd, (XDGAButtonEvent *)event );
245 if (event->type == DGAButtonReleaseEventType) {
246 TRACE("DGAButtonReleaseEvent received.\n");
247 X11DRV_DGAButtonReleaseEvent( DGAhwnd, (XDGAButtonEvent *)event );
250 if ((event->type == DGAKeyPressEventType) ||
251 (event->type == DGAKeyReleaseEventType)) {
252 /* Fill a XKeyEvent to send to EVENT_Key */
254 XDGAKeyEvent *evt = (XDGAKeyEvent *) event;
256 TRACE("DGAKeyPress/ReleaseEvent received.\n");
258 if (evt->type == DGAKeyReleaseEventType)
259 ke.type = KeyRelease;
262 ke.serial = evt->serial;
263 ke.send_event = FALSE;
264 ke.display = evt->display;
273 ke.state = evt->state;
274 ke.keycode = evt->keycode;
275 ke.same_screen = TRUE;
276 X11DRV_KeyEvent( 0, &ke );
283 if (XFindContext( display, event->xany.window, winContext, (char **)&hWnd ) != 0)
284 hWnd = 0; /* Not for a registered window */
286 if (!hWnd && event->xany.window == root_window) hWnd = GetDesktopWindow();
288 if (!hWnd && event->type != PropertyNotify &&
289 event->type != MappingNotify && event->type != KeymapNotify)
290 WARN( "Got event %s for unknown Window %08lx\n",
291 event_names[event->type], event->xany.window );
292 else if (event->type <= MappingNotify)
293 TRACE("Got event %s for hwnd/window %p/%lx, GetFocus()=%p\n",
294 event_names[event->type], hWnd, event->xany.window, GetFocus() );
296 TRACE("Got extension event for hwnd/window %p/%lx, GetFocus()=%p\n",
297 hWnd, event->xany.window, GetFocus() );
299 if (X11DRV_ProcessTabletEvent(hWnd, event))
301 TRACE("Return: filtered by tablet\n");
309 /* FIXME: should generate a motion event if event point is different from current pos */
310 X11DRV_KeyEvent( hWnd, (XKeyEvent*)event );
314 X11DRV_ButtonPress( hWnd, (XButtonEvent*)event );
318 X11DRV_ButtonRelease( hWnd, (XButtonEvent*)event );
322 X11DRV_MotionNotify( hWnd, (XMotionEvent*)event );
326 X11DRV_EnterNotify( hWnd, (XCrossingEvent*)event );
330 EVENT_FocusIn( hWnd, (XFocusChangeEvent*)event );
334 EVENT_FocusOut( hWnd, (XFocusChangeEvent*)event );
338 X11DRV_Expose( hWnd, &event->xexpose );
341 case ConfigureNotify:
343 X11DRV_ConfigureNotify( hWnd, &event->xconfigure );
346 case SelectionRequest:
347 X11DRV_SelectionRequest( hWnd, (XSelectionRequestEvent *)event );
351 X11DRV_SelectionClear( hWnd, (XSelectionClearEvent*) event );
355 EVENT_PropertyNotify( (XPropertyEvent *)event );
360 EVENT_ClientMessage( hWnd, (XClientMessageEvent *) event );
367 X11DRV_MapNotify( hWnd, (XMapEvent *)event );
371 X11DRV_UnmapNotify( hWnd, (XUnmapEvent *)event );
375 X11DRV_KeymapNotify( hWnd, (XKeymapEvent *)event );
379 X11DRV_MappingNotify( (XMappingEvent *) event );
383 WARN("Unprocessed event %s for hwnd %p\n", event_names[event->type], hWnd );
386 TRACE( "returns.\n" );
390 /*******************************************************************
391 * can_activate_window
393 * Check if we can activate the specified window.
395 inline static BOOL can_activate_window( HWND hwnd )
397 LONG style = GetWindowLongW( hwnd, GWL_STYLE );
398 if (!(style & WS_VISIBLE)) return FALSE;
399 if ((style & (WS_POPUP|WS_CHILD)) == WS_CHILD) return FALSE;
400 return !(style & WS_DISABLED);
404 /**********************************************************************
407 static void set_focus( HWND hwnd, Time time )
412 TRACE( "setting foreground window to %p\n", hwnd );
413 SetForegroundWindow( hwnd );
416 if (focus) focus = GetAncestor( focus, GA_ROOT );
417 win = X11DRV_get_whole_window(focus);
421 TRACE( "setting focus to %p (%lx) time=%ld\n", focus, win, time );
423 XSetInputFocus( thread_display(), win, RevertToParent, time );
429 /**********************************************************************
430 * handle_wm_protocols_message
432 static void handle_wm_protocols_message( HWND hwnd, XClientMessageEvent *event )
434 Atom protocol = (Atom)event->data.l[0];
436 if (!protocol) return;
438 if (protocol == x11drv_atom(WM_DELETE_WINDOW))
440 /* Ignore the delete window request if the window has been disabled
441 * and we are in managed mode. This is to disallow applications from
442 * being closed by the window manager while in a modal state.
444 if (IsWindowEnabled(hwnd)) PostMessageW( hwnd, WM_SYSCOMMAND, SC_CLOSE, 0 );
446 else if (protocol == x11drv_atom(WM_TAKE_FOCUS))
448 Time event_time = (Time)event->data.l[1];
449 HWND last_focus = x11drv_thread_data()->last_focus;
451 TRACE( "got take focus msg for %p, enabled=%d, focus=%p, active=%p, fg=%p, last=%p\n",
452 hwnd, IsWindowEnabled(hwnd), GetFocus(), GetActiveWindow(),
453 GetForegroundWindow(), last_focus );
455 if (can_activate_window(hwnd))
457 /* simulate a mouse click on the caption to find out
458 * whether the window wants to be activated */
459 LRESULT ma = SendMessageW( hwnd, WM_MOUSEACTIVATE,
460 (WPARAM)GetAncestor( hwnd, GA_ROOT ),
461 MAKELONG(HTCAPTION,WM_LBUTTONDOWN) );
462 if (ma != MA_NOACTIVATEANDEAT && ma != MA_NOACTIVATE) set_focus( hwnd, event_time );
463 else TRACE( "not setting focus to %p (%lx), ma=%ld\n", hwnd, event->window, ma );
468 if (hwnd) hwnd = GetAncestor( hwnd, GA_ROOT );
469 if (!hwnd) hwnd = GetActiveWindow();
470 if (!hwnd) hwnd = last_focus;
471 if (hwnd && can_activate_window(hwnd)) set_focus( hwnd, event_time );
474 else if (protocol == x11drv_atom(_NET_WM_PING))
476 XClientMessageEvent xev;
479 TRACE("NET_WM Ping\n");
480 xev.window = DefaultRootWindow(xev.display);
481 XSendEvent(xev.display, xev.window, False, SubstructureRedirectMask | SubstructureNotifyMask, (XEvent*)&xev);
482 /* this line is semi-stolen from gtk2 */
483 TRACE("NET_WM Pong\n");
488 static const char * const focus_details[] =
494 "NotifyNonlinearVirtual",
500 /**********************************************************************
503 static void EVENT_FocusIn( HWND hwnd, XFocusChangeEvent *event )
509 TRACE( "win %p xwin %lx detail=%s\n", hwnd, event->window, focus_details[event->detail] );
511 if (event->detail == NotifyPointer) return;
513 if ((xic = X11DRV_get_ic( hwnd )))
519 if (use_take_focus) return; /* ignore FocusIn if we are using take focus */
521 if (!can_activate_window(hwnd))
523 HWND hwnd = GetFocus();
524 if (hwnd) hwnd = GetAncestor( hwnd, GA_ROOT );
525 if (!hwnd) hwnd = GetActiveWindow();
526 if (!hwnd) hwnd = x11drv_thread_data()->last_focus;
527 if (hwnd && can_activate_window(hwnd)) set_focus( hwnd, CurrentTime );
529 else SetForegroundWindow( hwnd );
533 /**********************************************************************
536 * Note: only top-level windows get FocusOut events.
538 static void EVENT_FocusOut( HWND hwnd, XFocusChangeEvent *event )
547 TRACE( "win %p xwin %lx detail=%s\n", hwnd, event->window, focus_details[event->detail] );
549 if (event->detail == NotifyPointer) return;
550 if (ximInComposeMode) return;
552 x11drv_thread_data()->last_focus = hwnd;
553 if ((xic = X11DRV_get_ic( hwnd )))
556 XUnsetICFocus( xic );
559 if (hwnd != GetForegroundWindow()) return;
560 SendMessageA( hwnd, WM_CANCELMODE, 0, 0 );
562 /* don't reset the foreground window, if the window which is
563 getting the focus is a Wine window */
566 XGetInputFocus( thread_display(), &focus_win, &revert );
569 if (XFindContext( thread_display(), focus_win, winContext, (char **)&hwnd_tmp ) != 0)
576 /* Abey : 6-Oct-99. Check again if the focus out window is the
577 Foreground window, because in most cases the messages sent
578 above must have already changed the foreground window, in which
579 case we don't have to change the foreground window to 0 */
580 if (hwnd == GetForegroundWindow())
582 TRACE( "lost focus, setting fg to 0\n" );
583 SetForegroundWindow( 0 );
589 /***********************************************************************
590 * EVENT_PropertyNotify
591 * We use this to release resources like Pixmaps when a selection
592 * client no longer needs them.
594 static void EVENT_PropertyNotify( XPropertyEvent *event )
596 /* Check if we have any resources to free */
597 TRACE("Received PropertyNotify event: \n");
603 TRACE("\tPropertyDelete for atom %ld on window %ld\n",
604 event->atom, (long)event->window);
608 case PropertyNewValue:
610 TRACE("\tPropertyNewValue for atom %ld on window %ld\n\n",
611 event->atom, (long)event->window);
620 static HWND find_drop_window( HWND hQueryWnd, LPPOINT lpPt )
624 if (!IsWindowEnabled(hQueryWnd)) return 0;
626 GetWindowRect(hQueryWnd, &tempRect);
628 if(!PtInRect(&tempRect, *lpPt)) return 0;
630 if (!IsIconic( hQueryWnd ))
632 GetClientRect( hQueryWnd, &tempRect );
633 MapWindowPoints( hQueryWnd, 0, (LPPOINT)&tempRect, 2 );
635 if (PtInRect( &tempRect, *lpPt))
637 HWND *list = WIN_ListChildren( hQueryWnd );
644 for (i = 0; list[i]; i++)
646 if (GetWindowLongW( list[i], GWL_STYLE ) & WS_VISIBLE)
648 GetWindowRect( list[i], &tempRect );
649 if (PtInRect( &tempRect, *lpPt )) break;
654 if (IsWindowEnabled( list[i] ))
655 bResult = find_drop_window( list[i], lpPt );
657 HeapFree( GetProcessHeap(), 0, list );
659 if(bResult) return bResult;
663 if(!(GetWindowLongA( hQueryWnd, GWL_EXSTYLE ) & WS_EX_ACCEPTFILES)) return 0;
665 ScreenToClient(hQueryWnd, lpPt);
670 /**********************************************************************
671 * EVENT_DropFromOffix
673 * don't know if it still works (last Changlog is from 96/11/04)
675 static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event )
677 unsigned long data_length;
678 unsigned long aux_long;
679 unsigned char* p_data = NULL;
690 Window win, w_aux_root, w_aux_child;
694 win = X11DRV_get_whole_window(hWnd);
696 XQueryPointer( event->display, win, &w_aux_root, &w_aux_child,
697 &x, &y, (int *) &u.pt_aux.x, (int *) &u.pt_aux.y,
698 (unsigned int*)&aux_long);
701 pWnd = WIN_GetPtr(hWnd);
703 /* find out drop point and drop window */
704 if( x < 0 || y < 0 ||
705 x > (pWnd->rectWindow.right - pWnd->rectWindow.left) ||
706 y > (pWnd->rectWindow.bottom - pWnd->rectWindow.top) )
708 bAccept = pWnd->dwExStyle & WS_EX_ACCEPTFILES;
715 HWND hwndDrop = find_drop_window( hWnd, &pt );
728 WIN_ReleasePtr(pWnd);
730 if (!bAccept) return;
733 XGetWindowProperty( event->display, DefaultRootWindow(event->display),
734 x11drv_atom(DndSelection), 0, 65535, FALSE,
735 AnyPropertyType, &u.atom_aux, (int *) &u.pt_aux.y,
736 &data_length, &aux_long, &p_data);
739 if( !aux_long && p_data) /* don't bother if > 64K */
741 signed char *p = (signed char*) p_data;
745 while( *p ) /* calculate buffer size */
748 if((u.i = *p) != -1 )
750 INT len = GetShortPathNameA( p, NULL, 0 );
751 if (len) aux_long += len + 1;
756 if( aux_long && aux_long < 65535 )
761 aux_long += sizeof(DROPFILES) + 1;
762 hDrop = GlobalAlloc( GMEM_SHARE, aux_long );
763 lpDrop = (DROPFILES*)GlobalLock( hDrop );
767 WND *pDropWnd = WIN_GetPtr( hScope );
768 lpDrop->pFiles = sizeof(DROPFILES);
772 ( x < (pDropWnd->rectClient.left - pDropWnd->rectWindow.left) ||
773 y < (pDropWnd->rectClient.top - pDropWnd->rectWindow.top) ||
774 x > (pDropWnd->rectClient.right - pDropWnd->rectWindow.left) ||
775 y > (pDropWnd->rectClient.bottom - pDropWnd->rectWindow.top) );
776 lpDrop->fWide = FALSE;
777 WIN_ReleasePtr(pDropWnd);
778 p_drop = (char *)(lpDrop + 1);
782 if( *p != -1 ) /* use only "good" entries */
784 GetShortPathNameA( p, p_drop, 65535 );
785 p_drop += strlen( p_drop ) + 1;
790 PostMessageA( hWnd, WM_DROPFILES, (WPARAM)hDrop, 0L );
795 if( p_data ) XFree(p_data);
799 /**********************************************************************
802 * drop items are separated by \n
803 * each item is prefixed by its mime type
805 * event->data.l[3], event->data.l[4] contains drop x,y position
807 static void EVENT_DropURLs( HWND hWnd, XClientMessageEvent *event )
809 unsigned long data_length;
810 unsigned long aux_long, drop_len = 0;
811 unsigned char *p_data = NULL; /* property data */
823 if (!(GetWindowLongW( hWnd, GWL_EXSTYLE ) & WS_EX_ACCEPTFILES)) return;
826 XGetWindowProperty( event->display, DefaultRootWindow(event->display),
827 x11drv_atom(DndSelection), 0, 65535, FALSE,
828 AnyPropertyType, &u.atom_aux, &u.i,
829 &data_length, &aux_long, &p_data);
832 WARN("property too large, truncated!\n");
833 TRACE("urls=%s\n", p_data);
835 if( !aux_long && p_data) { /* don't bother if > 64K */
836 /* calculate length */
838 next = strchr(p, '\n');
841 if (strncmp(p,"file:",5) == 0 ) {
842 INT len = GetShortPathNameA( p+5, NULL, 0 );
843 if (len) drop_len += len + 1;
848 next = strchr(p, '\n');
854 if( drop_len && drop_len < 65535 ) {
856 XQueryPointer( event->display, root_window, &u.w_aux, &u.w_aux,
857 &x, &y, &u.i, &u.i, &u.i);
860 drop_len += sizeof(DROPFILES) + 1;
861 hDrop = GlobalAlloc( GMEM_SHARE, drop_len );
862 lpDrop = (DROPFILES *) GlobalLock( hDrop );
865 WND *pDropWnd = WIN_GetPtr( hWnd );
866 lpDrop->pFiles = sizeof(DROPFILES);
867 lpDrop->pt.x = (INT)x;
868 lpDrop->pt.y = (INT)y;
870 ( x < (pDropWnd->rectClient.left - pDropWnd->rectWindow.left) ||
871 y < (pDropWnd->rectClient.top - pDropWnd->rectWindow.top) ||
872 x > (pDropWnd->rectClient.right - pDropWnd->rectWindow.left) ||
873 y > (pDropWnd->rectClient.bottom - pDropWnd->rectWindow.top) );
874 lpDrop->fWide = FALSE;
875 p_drop = (char*)(lpDrop + 1);
876 WIN_ReleasePtr(pDropWnd);
879 /* create message content */
882 next = strchr(p, '\n');
885 if (strncmp(p,"file:",5) == 0 ) {
886 INT len = GetShortPathNameA( p+5, p_drop, 65535 );
888 TRACE("drop file %s as %s\n", p+5, p_drop);
891 WARN("can't convert file %s to dos name \n", p+5);
894 WARN("unknown mime type %s\n", p);
899 next = strchr(p, '\n');
907 PostMessageA( hWnd, WM_DROPFILES, (WPARAM)hDrop, 0L );
911 if( p_data ) XFree(p_data);
916 /**********************************************************************
917 * EVENT_ClientMessage
919 static void EVENT_ClientMessage( HWND hWnd, XClientMessageEvent *event )
921 if (event->message_type != None && event->format == 32) {
922 if (event->message_type == x11drv_atom(WM_PROTOCOLS))
923 handle_wm_protocols_message( hWnd, event );
924 else if (event->message_type == x11drv_atom(DndProtocol))
926 /* query window (drag&drop event contains only drag window) */
928 int root_x, root_y, child_x, child_y;
932 XQueryPointer( event->display, root_window, &root, &child,
933 &root_x, &root_y, &child_x, &child_y, &u);
934 if (XFindContext( event->display, child, winContext, (char **)&hWnd ) != 0) hWnd = 0;
937 if (event->data.l[0] == DndFile || event->data.l[0] == DndFiles)
938 EVENT_DropFromOffiX(hWnd, event);
939 else if (event->data.l[0] == DndURL)
940 EVENT_DropURLs(hWnd, event);
942 else if (!X11DRV_XDND_Event(hWnd, event))
945 /* enable this if you want to see the message */
946 unsigned char* p_data = NULL;
953 XGetWindowProperty( event->display, DefaultRootWindow(event->display),
954 dndSelection, 0, 65535, FALSE,
955 AnyPropertyType, &u.atom, &u.i,
956 &u.l, &u.l, &p_data);
958 TRACE("message_type=%ld, data=%ld,%ld,%ld,%ld,%ld, msg=%s\n",
959 event->message_type, event->data.l[0], event->data.l[1],
960 event->data.l[2], event->data.l[3], event->data.l[4],
963 TRACE("unrecognized ClientMessage\n" );
969 /**********************************************************************
970 * X11DRV_EVENT_SetInputMethod
972 INPUT_TYPE X11DRV_EVENT_SetInputMethod(INPUT_TYPE type)
974 INPUT_TYPE prev = current_input_type;
976 /* Flag not used yet */
977 in_transition = FALSE;
978 current_input_type = type;
983 #ifdef HAVE_LIBXXF86DGA2
984 /**********************************************************************
985 * X11DRV_EVENT_SetDGAStatus
987 void X11DRV_EVENT_SetDGAStatus(HWND hwnd, int event_base)
989 if (event_base < 0) {
995 DGAMotionEventType = event_base + MotionNotify;
996 DGAButtonPressEventType = event_base + ButtonPress;
997 DGAButtonReleaseEventType = event_base + ButtonRelease;
998 DGAKeyPressEventType = event_base + KeyPress;
999 DGAKeyReleaseEventType = event_base + KeyRelease;