mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-09-25 10:48:34 +00:00
Merge pull request #699 from DaniElectra/wayland
Some checks are pending
Android Build / x64 (release) (push) Waiting to run
Android Build / arm64 (release) (push) Waiting to run
HTTP Server Build / build (push) Waiting to run
Hydra Core Build / Windows (push) Waiting to run
Hydra Core Build / MacOS (push) Waiting to run
Hydra Core Build / Linux (push) Waiting to run
Hydra Core Build / Android-x64 (push) Waiting to run
Linux AppImage Build / build (push) Waiting to run
Linux Build / build (push) Waiting to run
MacOS Build / MacOS-arm64 (push) Waiting to run
MacOS Build / MacOS-x86_64 (push) Waiting to run
MacOS Build / MacOS-Universal (push) Blocked by required conditions
Qt Build / Windows (push) Waiting to run
Qt Build / MacOS-arm64 (push) Waiting to run
Qt Build / MacOS-x86_64 (push) Waiting to run
Qt Build / MacOS-Universal (push) Blocked by required conditions
Qt Build / Linux (push) Waiting to run
Windows Build / build (push) Waiting to run
Some checks are pending
Android Build / x64 (release) (push) Waiting to run
Android Build / arm64 (release) (push) Waiting to run
HTTP Server Build / build (push) Waiting to run
Hydra Core Build / Windows (push) Waiting to run
Hydra Core Build / MacOS (push) Waiting to run
Hydra Core Build / Linux (push) Waiting to run
Hydra Core Build / Android-x64 (push) Waiting to run
Linux AppImage Build / build (push) Waiting to run
Linux Build / build (push) Waiting to run
MacOS Build / MacOS-arm64 (push) Waiting to run
MacOS Build / MacOS-x86_64 (push) Waiting to run
MacOS Build / MacOS-Universal (push) Blocked by required conditions
Qt Build / Windows (push) Waiting to run
Qt Build / MacOS-arm64 (push) Waiting to run
Qt Build / MacOS-x86_64 (push) Waiting to run
Qt Build / MacOS-Universal (push) Blocked by required conditions
Qt Build / Linux (push) Waiting to run
Windows Build / build (push) Waiting to run
Qt: Fix Wayland support
This commit is contained in:
commit
4ea15c9170
3 changed files with 4 additions and 5 deletions
|
@ -7,6 +7,5 @@ int main(int argc, char *argv[]) {
|
|||
QApplication app(argc, argv);
|
||||
MainWindow window(&app);
|
||||
|
||||
window.show();
|
||||
return app.exec();
|
||||
}
|
||||
|
|
|
@ -22,14 +22,13 @@ MainWindow::MainWindow(QApplication* app, QWidget* parent) : QMainWindow(parent)
|
|||
// Enable drop events for loading ROMs
|
||||
setAcceptDrops(true);
|
||||
resize(800, 240 * 4);
|
||||
show();
|
||||
|
||||
// We pass a callback to the screen widget that will be triggered every time we resize the screen
|
||||
screen = new ScreenWidget([this](u32 width, u32 height) { handleScreenResize(width, height); }, this);
|
||||
setCentralWidget(screen);
|
||||
|
||||
screen->show();
|
||||
appRunning = true;
|
||||
|
||||
// Set our menu bar up
|
||||
menuBar = new QMenuBar(nullptr);
|
||||
|
||||
|
@ -699,4 +698,4 @@ void MainWindow::setupControllerSensors(SDL_GameController* controller) {
|
|||
if (haveAccelerometer) {
|
||||
SDL_GameControllerSetSensorEnabled(controller, SDL_SENSOR_ACCEL, SDL_TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ ScreenWidget::ScreenWidget(ResizeCallback resizeCallback, QWidget* parent) : QWi
|
|||
setAttribute(Qt::WA_KeyCompression, false);
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
setMouseTracking(true);
|
||||
show();
|
||||
|
||||
if (!createGLContext()) {
|
||||
Helpers::panic("Failed to create GL context for display");
|
||||
|
@ -84,7 +85,7 @@ bool ScreenWidget::createGLContext() {
|
|||
}
|
||||
|
||||
qreal ScreenWidget::devicePixelRatioFromScreen() const {
|
||||
const QScreen* screenForRatio = window()->windowHandle()->screen();
|
||||
const QScreen* screenForRatio = windowHandle()->screen();
|
||||
if (!screenForRatio) {
|
||||
screenForRatio = QGuiApplication::primaryScreen();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue