mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-28 07:30:08 +01:00
Initial back-end server DND target support.
This commit is contained in:
parent
1df5903f9a
commit
6a7948491b
5 changed files with 927 additions and 101 deletions
|
|
@ -143,6 +143,8 @@ typedef struct _DMXInputInfo {
|
|||
int eventBase;
|
||||
} DMXInputInfo;
|
||||
|
||||
typedef struct _DMXDnDChild DMXDnDChild;
|
||||
|
||||
/** Global structure containing information about each backend screen. */
|
||||
typedef struct _DMXScreenInfo {
|
||||
DMXInputInfo input;
|
||||
|
|
@ -273,6 +275,9 @@ typedef struct _DMXScreenInfo {
|
|||
xcb_get_property_cookie_t getTypeProp;
|
||||
xcb_get_property_cookie_t getActionListProp;
|
||||
xcb_get_property_cookie_t getActionDescriptionProp;
|
||||
DMXDnDChild *dndChildren;
|
||||
int dndNChildren;
|
||||
xcb_query_tree_cookie_t queryTree;
|
||||
|
||||
/*---------- Other related information ----------*/
|
||||
|
||||
|
|
|
|||
971
hw/dmx/dmxdnd.c
971
hw/dmx/dmxdnd.c
File diff suppressed because it is too large
Load diff
|
|
@ -32,6 +32,12 @@ void
|
|||
dmxBEDnDRootWindowUpdate (ScreenPtr pScreen,
|
||||
Window window);
|
||||
|
||||
void
|
||||
dmxBEDnDSpriteUpdate (ScreenPtr pScreen,
|
||||
Window window,
|
||||
int rootX,
|
||||
int rootY);
|
||||
|
||||
Bool
|
||||
dmxScreenEventCheckDnD (ScreenPtr pScreen,
|
||||
xcb_generic_event_t *event);
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include "dmxlog.h"
|
||||
#include "dmxinput.h"
|
||||
#include "dmxgrab.h"
|
||||
#include "dmxdnd.h"
|
||||
#include "dmxwindow.h"
|
||||
#include "dmxcursor.h"
|
||||
#include "dmxscrinit.h"
|
||||
|
|
@ -577,7 +578,8 @@ dmxDeviceGrabPointer (DeviceIntPtr pDevice,
|
|||
.device_mode = XCB_GRAB_MODE_ASYNC,
|
||||
.owner_events = TRUE,
|
||||
.confine_to = confineTo,
|
||||
.cursor = cursor
|
||||
.cursor = cursor,
|
||||
.event_count = 3
|
||||
};
|
||||
xcb_protocol_request_t request = {
|
||||
2,
|
||||
|
|
@ -685,10 +687,13 @@ static void
|
|||
dmxUpdateSpriteFromEvent (DeviceIntPtr pDevice,
|
||||
xcb_window_t event,
|
||||
int x,
|
||||
int y)
|
||||
int y,
|
||||
int rootX,
|
||||
int rootY)
|
||||
{
|
||||
dmxDevicePrivPtr pDevPriv = DMX_GET_DEVICE_PRIV (pDevice);
|
||||
DMXScreenInfo *dmxScreen = (DMXScreenInfo *) pDevPriv->dmxInput;
|
||||
ScreenPtr pScreen = screenInfo.screens[dmxScreen->index];
|
||||
|
||||
if (event != dmxScreen->rootWin)
|
||||
{
|
||||
|
|
@ -736,6 +741,7 @@ dmxUpdateSpriteFromEvent (DeviceIntPtr pDevice,
|
|||
}
|
||||
|
||||
dmxEndFakeMotion (&dmxScreen->input);
|
||||
dmxBEDnDSpriteUpdate (pScreen, event, rootX, rootY);
|
||||
dmxUpdateSpritePosition (pDevice, x, y);
|
||||
}
|
||||
|
||||
|
|
@ -757,7 +763,9 @@ dmxDevicePointerEventCheck (DeviceIntPtr pDevice,
|
|||
dmxUpdateSpriteFromEvent (pButtonDev,
|
||||
xmotion->event,
|
||||
xmotion->event_x,
|
||||
xmotion->event_y);
|
||||
xmotion->event_y,
|
||||
xmotion->root_x,
|
||||
xmotion->root_y);
|
||||
} break;
|
||||
case XCB_BUTTON_PRESS:
|
||||
case XCB_BUTTON_RELEASE: {
|
||||
|
|
@ -767,7 +775,9 @@ dmxDevicePointerEventCheck (DeviceIntPtr pDevice,
|
|||
dmxUpdateSpriteFromEvent (pButtonDev,
|
||||
xbutton->event,
|
||||
xbutton->event_x,
|
||||
xbutton->event_y);
|
||||
xbutton->event_y,
|
||||
xbutton->root_x,
|
||||
xbutton->root_y);
|
||||
dmxChangeButtonState (pButtonDev,
|
||||
xbutton->detail,
|
||||
type);
|
||||
|
|
@ -798,7 +808,9 @@ dmxDevicePointerEventCheck (DeviceIntPtr pDevice,
|
|||
dmxUpdateSpriteFromEvent (pButtonDev,
|
||||
xmotion->event,
|
||||
xmotion->event_x,
|
||||
xmotion->event_y);
|
||||
xmotion->event_y,
|
||||
xmotion->root_x,
|
||||
xmotion->root_y);
|
||||
} break;
|
||||
case XCB_INPUT_DEVICE_BUTTON_PRESS:
|
||||
case XCB_INPUT_DEVICE_BUTTON_RELEASE: {
|
||||
|
|
@ -811,7 +823,9 @@ dmxDevicePointerEventCheck (DeviceIntPtr pDevice,
|
|||
dmxUpdateSpriteFromEvent (pButtonDev,
|
||||
xbutton->event,
|
||||
xbutton->event_x,
|
||||
xbutton->event_y);
|
||||
xbutton->event_y,
|
||||
xbutton->root_x,
|
||||
xbutton->root_y);
|
||||
dmxChangeButtonState (pButtonDev,
|
||||
xbutton->detail, XCB_BUTTON_RELEASE +
|
||||
(reltype -
|
||||
|
|
@ -879,7 +893,9 @@ dmxDeviceKeyboardEventCheck (DeviceIntPtr pDevice,
|
|||
dmxUpdateSpriteFromEvent (pButtonDev,
|
||||
xkey->event,
|
||||
xkey->event_x,
|
||||
xkey->event_y);
|
||||
xkey->event_y,
|
||||
xkey->root_x,
|
||||
xkey->root_y);
|
||||
|
||||
dmxChangeKeyState (pKeyDev,
|
||||
xkey->detail,
|
||||
|
|
@ -933,7 +949,9 @@ dmxDeviceKeyboardEventCheck (DeviceIntPtr pDevice,
|
|||
dmxUpdateSpriteFromEvent (pButtonDev,
|
||||
xkey->event,
|
||||
xkey->event_x,
|
||||
xkey->event_y);
|
||||
xkey->event_y,
|
||||
xkey->root_x,
|
||||
xkey->root_y);
|
||||
|
||||
dmxChangeKeyState (pKeyDev,
|
||||
xkey->detail, XCB_KEY_PRESS +
|
||||
|
|
|
|||
|
|
@ -463,7 +463,7 @@ dmxSelectionPropertyReply (ScreenPtr pScreen,
|
|||
|
||||
event.u.selectionNotify.property = None;
|
||||
|
||||
if (reply->response_type)
|
||||
if (reply)
|
||||
{
|
||||
Atom type = dmxAtom (dmxScreen, xproperty->type);
|
||||
uint32_t *data = xcb_get_property_value (xproperty);
|
||||
|
|
@ -894,6 +894,7 @@ dmxCreateSelectionProxies (void)
|
|||
XID overrideRedirect = TRUE;
|
||||
int result;
|
||||
int i;
|
||||
Atom xdndVersion = 5;
|
||||
|
||||
for (i = 0; i < DMX_N_SELECTION_PROXY; i++)
|
||||
{
|
||||
|
|
@ -965,6 +966,15 @@ dmxCreateSelectionProxies (void)
|
|||
}
|
||||
}
|
||||
|
||||
ChangeWindowProperty (dmxScreens[0].pSelectionProxyWin[0],
|
||||
dmxScreens[0].xdndAwareAtom,
|
||||
XA_ATOM,
|
||||
32,
|
||||
PropModeReplace,
|
||||
1,
|
||||
&xdndVersion,
|
||||
TRUE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue