xcbXorg: Replace display+screen with XConnectionIdentifier
This commit is contained in:
@@ -94,8 +94,7 @@ class AttachedDevice
|
|||||||
public:
|
public:
|
||||||
struct WindowSelector
|
struct WindowSelector
|
||||||
{
|
{
|
||||||
int display;
|
XcbConnection::XConnectionIdentifier xconn;
|
||||||
int screen;
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
@@ -106,8 +105,8 @@ public:
|
|||||||
std::string stringify() const
|
std::string stringify() const
|
||||||
{
|
{
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << "Display: " << display
|
os << "Display: " << xconn.display
|
||||||
<< ", Screen: " << screen
|
<< ", Screen: " << xconn.screen
|
||||||
<< ", Window: " << (useWindowId ?
|
<< ", Window: " << (useWindowId ?
|
||||||
std::to_string(window.id) :
|
std::to_string(window.id) :
|
||||||
"\"" + window.name + "\"");
|
"\"" + window.name + "\"");
|
||||||
@@ -120,8 +119,8 @@ public:
|
|||||||
: deviceSpec(spec)
|
: deviceSpec(spec)
|
||||||
, connection(std::move(conn))
|
, connection(std::move(conn))
|
||||||
{
|
{
|
||||||
windowSelector.display = getRequiredParamAsInt(spec, "display");
|
windowSelector.xconn.display = getRequiredParamAsInt(spec, "display");
|
||||||
windowSelector.screen = getRequiredParamAsInt(spec, "screen");
|
windowSelector.xconn.screen = getRequiredParamAsInt(spec, "screen");
|
||||||
parseWindowSelector(spec.deviceSelector, windowSelector);
|
parseWindowSelector(spec.deviceSelector, windowSelector);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -231,14 +230,15 @@ int xcbXorg_attachDeviceReq(const hk::device::SenseDeviceSpec &desc)
|
|||||||
// Create temporary device to validate parameters
|
// Create temporary device to validate parameters
|
||||||
AttachedDevice::WindowSelector tempSelector;
|
AttachedDevice::WindowSelector tempSelector;
|
||||||
|
|
||||||
tempSelector.display = AttachedDevice::getRequiredParamAsInt(
|
tempSelector.xconn.display = AttachedDevice::getRequiredParamAsInt(
|
||||||
desc, "display");
|
desc, "display");
|
||||||
tempSelector.screen = AttachedDevice::getRequiredParamAsInt(desc, "screen");
|
tempSelector.xconn.screen = AttachedDevice::getRequiredParamAsInt(
|
||||||
|
desc, "screen");
|
||||||
|
|
||||||
// Get or create connection before constructing device
|
// Get or create connection before constructing device
|
||||||
XcbConnection::XConnectionIdentifier id{
|
XcbConnection::XConnectionIdentifier id{
|
||||||
tempSelector.display,
|
tempSelector.xconn.display,
|
||||||
tempSelector.screen
|
tempSelector.xconn.screen
|
||||||
};
|
};
|
||||||
auto conn = XcbConnection::getOrCreateConnection(id);
|
auto conn = XcbConnection::getOrCreateConnection(id);
|
||||||
|
|
||||||
@@ -281,8 +281,8 @@ int xcbXorg_detachDeviceReq(const hk::device::SenseDeviceSpec &spec)
|
|||||||
}
|
}
|
||||||
|
|
||||||
XcbConnection::XConnectionIdentifier id{
|
XcbConnection::XConnectionIdentifier id{
|
||||||
it->windowSelector.display,
|
it->windowSelector.xconn.display,
|
||||||
it->windowSelector.screen
|
it->windowSelector.xconn.screen
|
||||||
};
|
};
|
||||||
|
|
||||||
// Atomic decrement refcount
|
// Atomic decrement refcount
|
||||||
|
|||||||
Reference in New Issue
Block a user