Skip to content

Commit

Permalink
Qt: Fix game list glitching out in X11
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek authored and refractionpcsx2 committed Jul 17, 2022
1 parent c11ca2f commit 1cee55b
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 134 deletions.
13 changes: 11 additions & 2 deletions pcsx2-qt/DisplayWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,15 +402,24 @@ DisplayContainer::DisplayContainer()

DisplayContainer::~DisplayContainer() = default;

bool DisplayContainer::IsNeeded(bool fullscreen, bool render_to_main)
bool DisplayContainer::isNeeded(bool fullscreen, bool render_to_main)
{
#if defined(_WIN32) || defined(__APPLE__)
return false;
#else
if (!fullscreen && render_to_main)
if (!isRunningOnWayland())
return false;

// We only need this on Wayland because of client-side decorations...
return (fullscreen || !render_to_main);
#endif
}

bool DisplayContainer::isRunningOnWayland()
{
#if defined(_WIN32) || defined(__APPLE__)
return false;
#else
const QString platform_name = QGuiApplication::platformName();
return (platform_name == QStringLiteral("wayland"));
#endif
Expand Down
5 changes: 4 additions & 1 deletion pcsx2-qt/DisplayWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ class DisplayContainer final : public QStackedWidget
DisplayContainer();
~DisplayContainer();

static bool IsNeeded(bool fullscreen, bool render_to_main);
// Wayland is broken in lots of ways, so we need to check for it.
static bool isRunningOnWayland();

static bool isNeeded(bool fullscreen, bool render_to_main);

void setDisplayWidget(DisplayWidget* widget);
DisplayWidget* removeDisplayWidget();
Expand Down
Loading

0 comments on commit 1cee55b

Please sign in to comment.