Skip to content

Commit

Permalink
MythXDisplay: Store the display string in use
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-kendall committed Oct 15, 2019
1 parent 76bca2a commit 5f3db62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mythtv/libs/libmythui/mythxdisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ bool MythXDisplay::Open(void)
{
MythXLocker locker(this);

QString dispStr = MythUIHelper::GetX11Display();
m_displayName = MythUIHelper::GetX11Display();
const char *dispCStr = nullptr;
if (!dispStr.isEmpty())
dispCStr = dispStr.toLatin1().constData();
if (!m_displayName.isEmpty())
dispCStr = m_displayName.toLatin1().constData();

m_disp = XOpenDisplay(dispCStr);
if (!m_disp)
Expand Down
3 changes: 3 additions & 0 deletions mythtv/libs/libmythui/mythxdisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#ifndef _MYTHXDISPLAY_X_
#define _MYTHXDISPLAY_X_

#include <QString>
#include <QMutex>

#ifdef USING_X11
Expand All @@ -19,6 +20,7 @@ class MUI_PUBLIC MythXDisplay
MythXDisplay() = default;
~MythXDisplay();
Display *GetDisplay(void) { return m_disp; }
QString GetDisplayName(void) const{ return m_displayName;}
int GetScreen(void) const { return m_screen_num; }
void Lock(void) { m_lock.lock(); }
void Unlock(void) { m_lock.unlock(); }
Expand Down Expand Up @@ -50,6 +52,7 @@ class MUI_PUBLIC MythXDisplay
GC m_gc {nullptr};
Window m_root {0};
QMutex m_lock {QMutex::Recursive};
QString m_displayName{};
};

class MythXLocker
Expand Down

0 comments on commit 5f3db62

Please sign in to comment.