winex11: Moved the ExposeEvent handler to event.c.
Use consistent naming for all event handlers.
This commit is contained in:
parent
3fd1fc7600
commit
585da9296d
|
@ -51,6 +51,7 @@
|
|||
#include "shlobj.h" /* DROPFILES */
|
||||
#include "shellapi.h"
|
||||
|
||||
#include "wine/server.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(event);
|
||||
|
@ -72,10 +73,11 @@ extern BOOL ximInComposeMode;
|
|||
#define DndURL 128 /* KDE drag&drop */
|
||||
|
||||
/* Event handlers */
|
||||
static void EVENT_FocusIn( HWND hwnd, XEvent *event );
|
||||
static void EVENT_FocusOut( HWND hwnd, XEvent *event );
|
||||
static void EVENT_PropertyNotify( HWND hwnd, XEvent *event );
|
||||
static void EVENT_ClientMessage( HWND hwnd, XEvent *event );
|
||||
static void X11DRV_FocusIn( HWND hwnd, XEvent *event );
|
||||
static void X11DRV_FocusOut( HWND hwnd, XEvent *event );
|
||||
static void X11DRV_Expose( HWND hwnd, XEvent *event );
|
||||
static void X11DRV_PropertyNotify( HWND hwnd, XEvent *event );
|
||||
static void X11DRV_ClientMessage( HWND hwnd, XEvent *event );
|
||||
|
||||
struct event_handler
|
||||
{
|
||||
|
@ -95,8 +97,8 @@ static struct event_handler handlers[MAX_EVENT_HANDLERS] =
|
|||
{ MotionNotify, X11DRV_MotionNotify },
|
||||
{ EnterNotify, X11DRV_EnterNotify },
|
||||
/* LeaveNotify */
|
||||
{ FocusIn, EVENT_FocusIn },
|
||||
{ FocusOut, EVENT_FocusOut },
|
||||
{ FocusIn, X11DRV_FocusIn },
|
||||
{ FocusOut, X11DRV_FocusOut },
|
||||
{ KeymapNotify, X11DRV_KeymapNotify },
|
||||
{ Expose, X11DRV_Expose },
|
||||
/* GraphicsExpose */
|
||||
|
@ -114,12 +116,12 @@ static struct event_handler handlers[MAX_EVENT_HANDLERS] =
|
|||
/* ResizeRequest */
|
||||
/* CirculateNotify */
|
||||
/* CirculateRequest */
|
||||
{ PropertyNotify, EVENT_PropertyNotify },
|
||||
{ PropertyNotify, X11DRV_PropertyNotify },
|
||||
{ SelectionClear, X11DRV_SelectionClear },
|
||||
{ SelectionRequest, X11DRV_SelectionRequest },
|
||||
/* SelectionNotify */
|
||||
/* ColormapNotify */
|
||||
{ ClientMessage, EVENT_ClientMessage },
|
||||
{ ClientMessage, X11DRV_ClientMessage },
|
||||
{ MappingNotify, X11DRV_MappingNotify },
|
||||
};
|
||||
|
||||
|
@ -568,9 +570,9 @@ static const char * const focus_details[] =
|
|||
};
|
||||
|
||||
/**********************************************************************
|
||||
* EVENT_FocusIn
|
||||
* X11DRV_FocusIn
|
||||
*/
|
||||
static void EVENT_FocusIn( HWND hwnd, XEvent *xev )
|
||||
static void X11DRV_FocusIn( HWND hwnd, XEvent *xev )
|
||||
{
|
||||
XFocusChangeEvent *event = &xev->xfocus;
|
||||
XIC xic;
|
||||
|
@ -602,11 +604,11 @@ static void EVENT_FocusIn( HWND hwnd, XEvent *xev )
|
|||
|
||||
|
||||
/**********************************************************************
|
||||
* EVENT_FocusOut
|
||||
* X11DRV_FocusOut
|
||||
*
|
||||
* Note: only top-level windows get FocusOut events.
|
||||
*/
|
||||
static void EVENT_FocusOut( HWND hwnd, XEvent *xev )
|
||||
static void X11DRV_FocusOut( HWND hwnd, XEvent *xev )
|
||||
{
|
||||
XFocusChangeEvent *event = &xev->xfocus;
|
||||
HWND hwnd_tmp;
|
||||
|
@ -658,6 +660,57 @@ static void EVENT_FocusOut( HWND hwnd, XEvent *xev )
|
|||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* X11DRV_Expose
|
||||
*/
|
||||
static void X11DRV_Expose( HWND hwnd, XEvent *xev )
|
||||
{
|
||||
XExposeEvent *event = &xev->xexpose;
|
||||
RECT rect;
|
||||
struct x11drv_win_data *data;
|
||||
int flags = RDW_INVALIDATE | RDW_ERASE;
|
||||
|
||||
TRACE( "win %p (%lx) %d,%d %dx%d\n",
|
||||
hwnd, event->window, event->x, event->y, event->width, event->height );
|
||||
|
||||
if (!(data = X11DRV_get_win_data( hwnd ))) return;
|
||||
|
||||
if (event->window == data->whole_window)
|
||||
{
|
||||
rect.left = data->whole_rect.left + event->x;
|
||||
rect.top = data->whole_rect.top + event->y;
|
||||
flags |= RDW_FRAME;
|
||||
}
|
||||
else
|
||||
{
|
||||
rect.left = data->client_rect.left + event->x;
|
||||
rect.top = data->client_rect.top + event->y;
|
||||
}
|
||||
rect.right = rect.left + event->width;
|
||||
rect.bottom = rect.top + event->height;
|
||||
|
||||
if (event->window != root_window)
|
||||
{
|
||||
SERVER_START_REQ( update_window_zorder )
|
||||
{
|
||||
req->window = hwnd;
|
||||
req->rect.left = rect.left;
|
||||
req->rect.top = rect.top;
|
||||
req->rect.right = rect.right;
|
||||
req->rect.bottom = rect.bottom;
|
||||
wine_server_call( req );
|
||||
}
|
||||
SERVER_END_REQ;
|
||||
|
||||
/* make position relative to client area instead of parent */
|
||||
OffsetRect( &rect, -data->client_rect.left, -data->client_rect.top );
|
||||
flags |= RDW_ALLCHILDREN;
|
||||
}
|
||||
|
||||
RedrawWindow( hwnd, &rect, 0, flags );
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* get_window_wm_state
|
||||
*/
|
||||
|
@ -755,9 +808,9 @@ static void handle_wm_state_notify( struct x11drv_win_data *data, XPropertyEvent
|
|||
|
||||
|
||||
/***********************************************************************
|
||||
* EVENT_PropertyNotify
|
||||
* X11DRV_PropertyNotify
|
||||
*/
|
||||
static void EVENT_PropertyNotify( HWND hwnd, XEvent *xev )
|
||||
static void X11DRV_PropertyNotify( HWND hwnd, XEvent *xev )
|
||||
{
|
||||
XPropertyEvent *event = &xev->xproperty;
|
||||
struct x11drv_win_data *data;
|
||||
|
@ -1130,9 +1183,9 @@ static const struct client_message_handler client_messages[] =
|
|||
|
||||
|
||||
/**********************************************************************
|
||||
* EVENT_ClientMessage
|
||||
* X11DRV_ClientMessage
|
||||
*/
|
||||
static void EVENT_ClientMessage( HWND hwnd, XEvent *xev )
|
||||
static void X11DRV_ClientMessage( HWND hwnd, XEvent *xev )
|
||||
{
|
||||
XClientMessageEvent *event = &xev->xclient;
|
||||
unsigned int i;
|
||||
|
|
|
@ -60,57 +60,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(x11drv);
|
|||
|
||||
static const char managed_prop[] = "__wine_x11_managed";
|
||||
|
||||
/***********************************************************************
|
||||
* X11DRV_Expose
|
||||
*/
|
||||
void X11DRV_Expose( HWND hwnd, XEvent *xev )
|
||||
{
|
||||
XExposeEvent *event = &xev->xexpose;
|
||||
RECT rect;
|
||||
struct x11drv_win_data *data;
|
||||
int flags = RDW_INVALIDATE | RDW_ERASE;
|
||||
|
||||
TRACE( "win %p (%lx) %d,%d %dx%d\n",
|
||||
hwnd, event->window, event->x, event->y, event->width, event->height );
|
||||
|
||||
if (!(data = X11DRV_get_win_data( hwnd ))) return;
|
||||
|
||||
if (event->window == data->whole_window)
|
||||
{
|
||||
rect.left = data->whole_rect.left + event->x;
|
||||
rect.top = data->whole_rect.top + event->y;
|
||||
flags |= RDW_FRAME;
|
||||
}
|
||||
else
|
||||
{
|
||||
rect.left = data->client_rect.left + event->x;
|
||||
rect.top = data->client_rect.top + event->y;
|
||||
}
|
||||
rect.right = rect.left + event->width;
|
||||
rect.bottom = rect.top + event->height;
|
||||
|
||||
if (event->window != root_window)
|
||||
{
|
||||
SERVER_START_REQ( update_window_zorder )
|
||||
{
|
||||
req->window = hwnd;
|
||||
req->rect.left = rect.left;
|
||||
req->rect.top = rect.top;
|
||||
req->rect.right = rect.right;
|
||||
req->rect.bottom = rect.bottom;
|
||||
wine_server_call( req );
|
||||
}
|
||||
SERVER_END_REQ;
|
||||
|
||||
/* make position relative to client area instead of parent */
|
||||
OffsetRect( &rect, -data->client_rect.left, -data->client_rect.top );
|
||||
flags |= RDW_ALLCHILDREN;
|
||||
}
|
||||
|
||||
RedrawWindow( hwnd, &rect, 0, flags );
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* update_net_wm_states
|
||||
*/
|
||||
|
|
|
@ -641,7 +641,6 @@ extern void X11DRV_MotionNotify( HWND hwnd, XEvent *event );
|
|||
extern void X11DRV_EnterNotify( HWND hwnd, XEvent *event );
|
||||
extern void X11DRV_KeyEvent( HWND hwnd, XEvent *event );
|
||||
extern void X11DRV_KeymapNotify( HWND hwnd, XEvent *event );
|
||||
extern void X11DRV_Expose( HWND hwnd, XEvent *event );
|
||||
extern void X11DRV_DestroyNotify( HWND hwnd, XEvent *event );
|
||||
extern void X11DRV_MapNotify( HWND hwnd, XEvent *event );
|
||||
extern void X11DRV_ConfigureNotify( HWND hwnd, XEvent *event );
|
||||
|
|
Loading…
Reference in New Issue