mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-18 23:30:43 +01:00
Add dbus method attachScreenAt.
This commit is contained in:
parent
1dfa85d97a
commit
99045bfaf2
4 changed files with 106 additions and 27 deletions
119
hw/dmx/dmxdbus.c
119
hw/dmx/dmxdbus.c
|
|
@ -137,34 +137,22 @@ disable_screen (DBusMessage *message,
|
|||
}
|
||||
|
||||
static int
|
||||
attach_screen (DBusMessage *message,
|
||||
attach_screen (uint32_t window,
|
||||
uint32_t screen,
|
||||
uint32_t auth_type_len,
|
||||
uint32_t auth_data_len,
|
||||
const char *display,
|
||||
const char *auth_type,
|
||||
const char *auth_data,
|
||||
const char *name,
|
||||
int32_t x,
|
||||
int32_t y,
|
||||
DBusMessage *reply,
|
||||
DBusError *error)
|
||||
{
|
||||
DMXScreenAttributesRec attr;
|
||||
uint32_t window, screen, auth_type_len, auth_data_len;
|
||||
char *display, *auth_type, *auth_data, *name;
|
||||
int ret;
|
||||
|
||||
if (!dbus_message_get_args (message, error,
|
||||
DBUS_TYPE_UINT32,
|
||||
&screen,
|
||||
DBUS_TYPE_STRING,
|
||||
&display,
|
||||
DBUS_TYPE_STRING,
|
||||
&name,
|
||||
DBUS_TYPE_UINT32,
|
||||
&window,
|
||||
DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE,
|
||||
&auth_type, &auth_type_len,
|
||||
DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE,
|
||||
&auth_data, &auth_data_len,
|
||||
DBUS_TYPE_INVALID))
|
||||
{
|
||||
DebugF (MALFORMED_MSG ": %s, %s", error->name, error->message);
|
||||
return BadValue;
|
||||
}
|
||||
|
||||
if (!*name)
|
||||
{
|
||||
dbus_set_error (error,
|
||||
|
|
@ -194,8 +182,10 @@ attach_screen (DBusMessage *message,
|
|||
|
||||
memset (&attr, 0, sizeof (attr));
|
||||
|
||||
attr.name = name;
|
||||
attr.displayName = display;
|
||||
attr.name = name;
|
||||
attr.displayName = display;
|
||||
attr.rootWindowXoffset = x;
|
||||
attr.rootWindowYoffset = y;
|
||||
|
||||
ret = dmxAttachScreen (screen,
|
||||
&attr,
|
||||
|
|
@ -217,6 +207,83 @@ attach_screen (DBusMessage *message,
|
|||
return Success;
|
||||
}
|
||||
|
||||
static int
|
||||
attach_screen_without_offset (DBusMessage *message,
|
||||
DBusMessage *reply,
|
||||
DBusError *error)
|
||||
{
|
||||
uint32_t window, screen, auth_type_len, auth_data_len;
|
||||
char *display, *auth_type, *auth_data, *name;
|
||||
|
||||
if (!dbus_message_get_args (message, error,
|
||||
DBUS_TYPE_UINT32,
|
||||
&screen,
|
||||
DBUS_TYPE_STRING,
|
||||
&display,
|
||||
DBUS_TYPE_STRING,
|
||||
&name,
|
||||
DBUS_TYPE_UINT32,
|
||||
&window,
|
||||
DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE,
|
||||
&auth_type, &auth_type_len,
|
||||
DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE,
|
||||
&auth_data, &auth_data_len,
|
||||
DBUS_TYPE_INVALID))
|
||||
{
|
||||
DebugF (MALFORMED_MSG ": %s, %s", error->name, error->message);
|
||||
return BadValue;
|
||||
}
|
||||
|
||||
return attach_screen (window, screen,
|
||||
auth_type_len, auth_data_len,
|
||||
display,
|
||||
auth_type, auth_data,
|
||||
name,
|
||||
0, 0,
|
||||
reply, error);
|
||||
}
|
||||
|
||||
static int
|
||||
attach_screen_with_offset (DBusMessage *message,
|
||||
DBusMessage *reply,
|
||||
DBusError *error)
|
||||
{
|
||||
uint32_t window, screen, auth_type_len, auth_data_len;
|
||||
int32_t x, y;
|
||||
char *display, *auth_type, *auth_data, *name;
|
||||
|
||||
if (!dbus_message_get_args (message, error,
|
||||
DBUS_TYPE_UINT32,
|
||||
&screen,
|
||||
DBUS_TYPE_STRING,
|
||||
&display,
|
||||
DBUS_TYPE_STRING,
|
||||
&name,
|
||||
DBUS_TYPE_UINT32,
|
||||
&window,
|
||||
DBUS_TYPE_INT32,
|
||||
&x,
|
||||
DBUS_TYPE_INT32,
|
||||
&y,
|
||||
DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE,
|
||||
&auth_type, &auth_type_len,
|
||||
DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE,
|
||||
&auth_data, &auth_data_len,
|
||||
DBUS_TYPE_INVALID))
|
||||
{
|
||||
DebugF (MALFORMED_MSG ": %s, %s", error->name, error->message);
|
||||
return BadValue;
|
||||
}
|
||||
|
||||
return attach_screen (window, screen,
|
||||
auth_type_len, auth_data_len,
|
||||
display,
|
||||
auth_type, auth_data,
|
||||
name,
|
||||
x, y,
|
||||
reply, error);
|
||||
}
|
||||
|
||||
static int
|
||||
detach_screen (DBusMessage *message,
|
||||
DBusMessage *reply,
|
||||
|
|
@ -425,7 +492,9 @@ message_handler (DBusConnection *connection,
|
|||
else if (strcmp (dbus_message_get_member (message), "disableScreen") == 0)
|
||||
err = disable_screen (message, reply, &error);
|
||||
else if (strcmp (dbus_message_get_member (message), "attachScreen") == 0)
|
||||
err = attach_screen (message, reply, &error);
|
||||
err = attach_screen_without_offset (message, reply, &error);
|
||||
else if (strcmp (dbus_message_get_member (message), "attachScreenAt") == 0)
|
||||
err = attach_screen_with_offset (message, reply, &error);
|
||||
else if (strcmp (dbus_message_get_member (message), "detachScreen") == 0)
|
||||
err = detach_screen (message, reply, &error);
|
||||
else if (strcmp (dbus_message_get_member (message), "addInput") == 0)
|
||||
|
|
|
|||
|
|
@ -1622,6 +1622,9 @@ dmxAttachScreen (int idx,
|
|||
dmxScreen->beAttachedDisplay = dmxScreen->beDisplay;
|
||||
dmxScreen->beDisplay = NULL;
|
||||
|
||||
dmxScreen->rootX = attr->rootWindowXoffset;
|
||||
dmxScreen->rootY = attr->rootWindowYoffset;
|
||||
|
||||
return 0; /* Success */
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -710,7 +710,9 @@ dmxRRScreenSetSize (ScreenPtr pScreen,
|
|||
int i;
|
||||
|
||||
for (i = 0; i < dmxNumScreens; i++)
|
||||
dmxResizeRootWindow (WindowTable[i], 0, 0, width, height);
|
||||
dmxResizeRootWindow (WindowTable[i],
|
||||
dmxScreens[i].rootX, dmxScreens[i].rootY,
|
||||
width, height);
|
||||
|
||||
for (i = 0; i < dmxNumScreens; i++)
|
||||
dmxUpdateScreenResources (screenInfo.screens[i],
|
||||
|
|
@ -723,7 +725,10 @@ dmxRRScreenSetSize (ScreenPtr pScreen,
|
|||
else
|
||||
#endif
|
||||
{
|
||||
dmxResizeRootWindow (WindowTable[pScreen->myNum], 0, 0, width, height);
|
||||
dmxResizeRootWindow (WindowTable[pScreen->myNum],
|
||||
dmxScreens[pScreen->myNum].rootX,
|
||||
dmxScreens[pScreen->myNum].rootY,
|
||||
width, height);
|
||||
dmxUpdateScreenResources (pScreen, 0, 0, width, height);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -141,7 +141,9 @@ Window dmxCreateRootWindow(WindowPtr pWindow)
|
|||
XLIB_PROLOGUE (dmxScreen);
|
||||
win = XCreateWindow(dmxScreen->beDisplay,
|
||||
parent,
|
||||
dmxScreen->rootX +
|
||||
pWindow->origin.x - wBorderWidth(pWindow),
|
||||
dmxScreen->rootY +
|
||||
pWindow->origin.y - wBorderWidth(pWindow),
|
||||
w,
|
||||
h,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue