mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-11 00:58:14 +08:00
Added -display option for X11 version.
This commit is contained in:
@@ -103,7 +103,7 @@ static const KeySym g_map1008FF[] =
|
||||
|
||||
CXWindowsScreen* CXWindowsScreen::s_screen = NULL;
|
||||
|
||||
CXWindowsScreen::CXWindowsScreen(bool isPrimary) :
|
||||
CXWindowsScreen::CXWindowsScreen(const char* displayName, bool isPrimary) :
|
||||
m_isPrimary(isPrimary),
|
||||
m_display(NULL),
|
||||
m_root(None),
|
||||
@@ -132,7 +132,7 @@ CXWindowsScreen::CXWindowsScreen(bool isPrimary) :
|
||||
XSetIOErrorHandler(&CXWindowsScreen::ioErrorHandler);
|
||||
|
||||
try {
|
||||
m_display = openDisplay();
|
||||
m_display = openDisplay(displayName);
|
||||
m_root = DefaultRootWindow(m_display);
|
||||
saveShape();
|
||||
m_window = openWindow();
|
||||
@@ -599,12 +599,14 @@ CXWindowsScreen::fakeMouseWheel(SInt32 delta) const
|
||||
}
|
||||
|
||||
Display*
|
||||
CXWindowsScreen::openDisplay() const
|
||||
CXWindowsScreen::openDisplay(const char* displayName) const
|
||||
{
|
||||
// get the DISPLAY
|
||||
const char* displayName = getenv("DISPLAY");
|
||||
if (displayName == NULL) {
|
||||
displayName = ":0.0";
|
||||
displayName = getenv("DISPLAY");
|
||||
if (displayName == NULL) {
|
||||
displayName = ":0.0";
|
||||
}
|
||||
}
|
||||
|
||||
// open the display
|
||||
|
||||
@@ -30,7 +30,7 @@ class CXWindowsScreenSaver;
|
||||
//! Implementation of IPlatformScreen for X11
|
||||
class CXWindowsScreen : public CPlatformScreen {
|
||||
public:
|
||||
CXWindowsScreen(bool isPrimary);
|
||||
CXWindowsScreen(const char* displayName, bool isPrimary);
|
||||
virtual ~CXWindowsScreen();
|
||||
|
||||
//! @name manipulators
|
||||
@@ -111,7 +111,7 @@ private:
|
||||
KeyCode m_keycode;
|
||||
};
|
||||
|
||||
Display* openDisplay() const;
|
||||
Display* openDisplay(const char* displayName) const;
|
||||
void saveShape();
|
||||
Window openWindow() const;
|
||||
void openIM();
|
||||
|
||||
Reference in New Issue
Block a user