Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.12.0 upgrade hit black screen with multiple monitors #496

Closed
F1nny opened this issue Sep 16, 2015 · 22 comments

Comments

@F1nny
Copy link

commented Sep 16, 2015

Hey guys,
Running Arch Linux with all the standard repos and Plasma 5, after upgrading sddm 0.11.0-3 -> 0.12.0-2 hitting a bit of an issue, may be related to having multiple monitors but not too sure. I have 4 monitors with the 3rd (LTR) being the primary/where the login typically displays, upon starting the 1st monitor displays correctly (just the typical plasma SDDM background but no prompt) however monitors 2,3,4 are all black. The mouse cursor correctly displays and traverses all monitors however when over monitors 2-4 its the X icon instead of the cursor, of course because the 3rd monitor is not displaying properly it prevents me from logging in. Downgrading back to 0.11.0-3 resolves the issue as expected but wondering what the issue could be. Running the latest nvidia 352.41-1 and all 4 monitors are plugged into the one nvidia card, everything else is up to date and not using any testing/etc repos at the moment.

Can see some errors in the log related to QObject as shown:

Sep 16 09:13:19 cmast systemd[1]: Started Simple Desktop Display Manager.
Sep 16 09:13:19 cmast sddm[1160]: Initializing...
Sep 16 09:13:19 cmast sddm[1160]: Starting...
Sep 16 09:13:19 cmast sddm[1160]: Adding new display on vt 1 ...
Sep 16 09:13:19 cmast sddm[1160]: Display server starting...
Sep 16 09:13:19 cmast sddm[1160]: Running: /usr/bin/X -nolisten tcp -auth /var/run/sddm/{a481a54f-e0ca-462e-a4be-31bcf37cf05a} -background none -noreset -displayfd 17 vt1
Sep 16 09:13:20 cmast sddm[1160]: Running display setup script  "/usr/share/sddm/scripts/Xsetup"
Sep 16 09:13:20 cmast sddm[1160]: Display server started.
Sep 16 09:13:20 cmast sddm[1160]: Socket server starting...
Sep 16 09:13:20 cmast sddm[1160]: Socket server started.
Sep 16 09:13:20 cmast sddm[1160]: Greeter starting...
Sep 16 09:13:20 cmast sddm[1160]: Adding cookie to "/var/run/sddm/{a481a54f-e0ca-462e-a4be-31bcf37cf05a}"
Sep 16 09:13:20 cmast sddm-helper[1218]: [PAM] Starting...
Sep 16 09:13:20 cmast sddm-helper[1218]: [PAM] Authenticating...
Sep 16 09:13:20 cmast sddm-helper[1218]: [PAM] returning.
Sep 16 09:13:20 cmast sddm-helper[1218]: pam_unix(sddm-greeter:session): session opened for user sddm by (uid=0)
Sep 16 09:13:20 cmast systemd-logind[717]: New session c3 of user sddm.
Sep 16 09:13:20 cmast systemd[1]: Started Session c3 of user sddm.
Sep 16 09:13:20 cmast sddm[1160]: Greeter session started successfully
Sep 16 09:13:20 cmast sddm-greeter[1220]: Reading from "/usr/share/xsessions/kodi.desktop"
Sep 16 09:13:20 cmast sddm-greeter[1220]: Reading from "/usr/share/xsessions/plasma.desktop"
Sep 16 09:13:20 cmast sddm-greeter[1220]: Reading from "/usr/share/xsessions/failsafe.desktop"
Sep 16 09:13:20 cmast sddm-greeter[1220]: Connected to the daemon.
Sep 16 09:13:20 cmast sddm[1160]: Message received from greeter: Connect
Sep 16 09:13:21 cmast sddm-greeter[1220]: QObject: Cannot create children for a parent that is in a different thread.
                                          (Parent is SDDM::GreeterApp(0x7ffc67b14b90), parent's thread is QThread(0x14b34c0), current thread is QThread(0x1759f70)
Sep 16 09:13:21 cmast sddm-greeter[1220]: QObject: Cannot create children for a parent that is in a different thread.
                                          (Parent is SDDM::GreeterApp(0x7ffc67b14b90), parent's thread is QThread(0x14b34c0), current thread is QThread(0x1759f70)
Sep 16 09:13:21 cmast sddm-greeter[1220]: QObject: Cannot create children for a parent that is in a different thread.
                                          (Parent is SDDM::GreeterApp(0x7ffc67b14b90), parent's thread is QThread(0x14b34c0), current thread is QThread(0x1759f70)
Sep 16 09:13:21 cmast sddm-greeter[1220]: QObject: Cannot create children for a parent that is in a different thread.
                                          (Parent is SDDM::GreeterApp(0x7ffc67b14b90), parent's thread is QThread(0x14b34c0), current thread is QThread(0x1759f70)
Sep 16 09:13:21 cmast sddm-greeter[1220]: QObject::installEventFilter(): Cannot filter events for objects in a different thread.
Sep 16 09:13:21 cmast sddm-greeter[1220]: QObject: Cannot create children for a parent that is in a different thread.
                                          (Parent is SDDM::GreeterApp(0x7ffc67b14b90), parent's thread is QThread(0x14b34c0), current thread is QThread(0x1759f70)
Sep 16 09:13:21 cmast sddm-greeter[1220]: QObject::installEventFilter(): Cannot filter events for objects in a different thread.
Sep 16 09:13:22 cmast sddm-greeter[1220]: Message received from daemon: Capabilities
Sep 16 09:13:22 cmast sddm-greeter[1220]: Message received from daemon: HostName

I would guess it may have something to do with the added startup options maybe -displayfd? But really no idea as not too familiar with sddm, any ideas? Thanks guys!

@gatl

This comment has been minimized.

Copy link

commented Sep 16, 2015

I have the same issue.
I run two screens, connected to an ATI/AMD card. I have the small one on the left, and the large one, the primary one where the SDDM information is displayed, shows partially black (about 2/5ths of it). From the point about where the user image shows to the right edge of the screen, nothing is showed (except for the mouse cursor).
This happened when I upgraded to version 0.12 on Arch Linux.

@brenns10

This comment has been minimized.

Copy link

commented Sep 17, 2015

Same problem, but with two monitors. Second (primary) is black, and the only thing that shows up is an X shaped cursor (it's a normal themed cursor on the first screen). This problem just started happening with the update, and I have reproduced it on a completely fresh Arch install. If I just use startx, my DE loads with the displays working properly. My Xorg config was generated by nvidia-settings, so there should be nothing wrong with it.

I would be glad to provide debugging info, if anybody can give me some commands, logs, or configs they'd like to see.

@atilaneves

This comment has been minimized.

Copy link

commented Sep 18, 2015

I have the same problem. I had to downgrade to 0.11 to be able to login. In my case I couldn't even access the ttys in F2-F6, I had to boot using a USB drive and disable the service from a chroot. One screen had normal graphics but no login, the other was black with a cross mouse pointer.

@smartiq

This comment has been minimized.

Copy link

commented Sep 20, 2015

I just hit this on two of my computers. Both have three monitors. Since the upgrade to 0.12 sddm starts on one monitor only and the other ones show what appears to be a raw X server. Reverting to 0.11 fixed it for me.

@jleclanche

This comment has been minimized.

Copy link
Member

commented Sep 20, 2015

FWIW I'm not hitting this with 2 monitors on 0.12.

@budimanjojo

This comment has been minimized.

Copy link

commented Sep 20, 2015

Same here, downgrading to version 0.11 solved the issue. Will keep using the older version until this is fixed.
For some reason the problem is not only on the blank sreen on second monitor (which is my primary monitor), but the mouse cursor is not pointed on the password field. So I had to manually clicked on the password box and start typing the password.

@plfiorini

This comment has been minimized.

Copy link
Member

commented Sep 20, 2015

Can you guys put this in /usr/share/sddm/scripts/Xsetup and pastebin the output file?

qtdiag -platform xcb &> /tmp/qtdiag.log

qtdiag comes from qttools, Fedora has it in qt5-qttools-devel

@budimanjojo

This comment has been minimized.

Copy link

commented Sep 20, 2015

Here you go.
cat /tmp/qtdiag.log
Qt 5.5.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.2.0) on "xcb"
OS: Manjaro Linux [linux version 4.2.0-1-MANJARO]

Architecture: x86_64; features: SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 AVX AVX2

Library info:
PrefixPath: /usr
DocumentationPath: /usr/share/doc/qt
HeadersPath: /usr/include/qt
LibrariesPath: /usr/lib
LibraryExecutablesPath: /usr/lib/qt/libexec
BinariesPath: /usr/lib/qt/bin
PluginsPath: /usr/lib/qt/plugins
ImportsPath: /usr/lib/qt/imports
Qml2ImportsPath: /usr/lib/qt/qml
ArchDataPath: /usr/lib/qt
DataPath: /usr/share/qt
TranslationsPath: /usr/share/qt/translations
ExamplesPath: /usr/share/doc/qt/examples
TestsPath: /usr/tests
SettingsPath: /etc/xdg

Standard paths [... denote writable entry]:
DesktopLocation: "Desktop" //Desktop
DocumentsLocation: "Documents" //Documents
FontsLocation: "Fonts" //.fonts
ApplicationsLocation: "Applications" //.local/share/applications /usr/local/share/applications /usr/share/applications
MusicLocation: "Music" //Music
MoviesLocation: "Movies" //Videos
PicturesLocation: "Pictures" //Pictures
TempLocation: "Temporary Directory" /tmp
HomeLocation: "Home" /
AppLocalDataLocation: "Application Data" //.local/share/QtProject/qtdiag /usr/local/share/QtProject/qtdiag /usr/share/QtProject/qtdiag
CacheLocation: "Cache" //.cache/QtProject/qtdiag
GenericDataLocation: "Shared Data" //.local/share /usr/local/share /usr/share
RuntimeLocation: "Runtime" /tmp/runtime-root
ConfigLocation: "Configuration" //.config /etc/xdg
DownloadLocation: "Download" //Downloads
GenericCacheLocation: "Shared Cache" //.cache
GenericConfigLocation: "Shared Configuration" //.config /etc/xdg
AppDataLocation: "Application Data" //.local/share/QtProject/qtdiag /usr/local/share/QtProject/qtdiag /usr/share/QtProject/qtdiag
AppConfigLocation: "Application Configuration" //.config/QtProject/qtdiag /etc/xdg/QtProject/qtdiag

File selectors (increasing order of precedence):
C unix linux manjaro

Network:
Using "OpenSSL 1.0.2d 9 Jul 2015", version: 0x1000204f

Platform capabilities: ThreadedPixmaps OpenGL ThreadedOpenGL WindowMasks MultipleWindows ForeignWindows NonFullScreenWindows NativeWidgets WindowManagement SyncState RasterGLSurface

Style hints:
mouseDoubleClickInterval: 400
mousePressAndHoldInterval: 800
startDragDistance: 10
startDragTime: 500
startDragVelocity: 0
keyboardInputInterval: 400
keyboardAutoRepeatRate: 30
cursorFlashTime: 1000
showIsFullScreen: 0
passwordMaskDelay: 0
passwordMaskCharacter: U+25CF
fontSmoothingGamma: 1
useRtlExtensions: 0
setFocusOnTouchRelease: 0
tabFocusBehavior: Qt::TabFocusBehavior(TabFocusAllControls)

Theme:
Styles: Fusion,Windows System font: "Sans Serif" 9
General font : "Sans Serif" 9
Fixed font : "monospace" 9
Title font : "DejaVu Sans" 12
Smallest font: "DejaVu Sans" 12

Screens: 2

0 "DVI-I-1" Depth: 24 Primary: yes

Geometry: 1920x1080+0+0 Available: 1920x1080+0+0
Virtual geometry: 3840x1080+0+0 Available: 3840x1080+0+0
2 virtual siblings
Physical size: 477x268 mm Refresh: 60 Hz
Physical DPI: 102.239,102.358 Logical DPI: 100.969,100.853
DevicePixelRatio: 1 Primary orientation: 2
Orientation: 2 Native orientation: 0 OrientationUpdateMask: 0

1 "HDMI-0" Depth: 24 Primary: no

Geometry: 1920x1080+1920+0 Available: 1920x1080+1920+0
Virtual geometry: 3840x1080+0+0 Available: 3840x1080+0+0
2 virtual siblings
Physical size: 477x268 mm Refresh: 60 Hz
Physical DPI: 102.239,102.358 Logical DPI: 100.969,100.853
DevicePixelRatio: 1 Primary orientation: 2
Orientation: 2 Native orientation: 0 OrientationUpdateMask: 0

LibGL Vendor: NVIDIA Corporation
Renderer: GeForce GTX 970/PCIe/SSE2
Version: 4.5.0 NVIDIA 355.11
Shading language: 4.50 NVIDIA
Format: Version: 4.5 Profile: 2 Swap behavior: 0 Buffer size (RGB): 8,8,8 Depth buffer: 24

@brenns10

This comment has been minimized.

Copy link

commented Sep 20, 2015

Here is what I got from qtdiag:
http://hastebin.com/iyoducesaw.sm

@mkaufmann

This comment has been minimized.

Copy link

commented Sep 21, 2015

Same problem, I see the theme on one desktop, but the main window with the textfield is not visible. I can enter my password blindely by using tab.

I have a three monitor setup, 2x: 1920x1080, 1x:1920x1200

Qtdiag log
http://hastebin.com/qududusuba.sm

@NeKJ

This comment has been minimized.

Copy link

commented Sep 21, 2015

Same problem. 2 monitors, primary is displaying but secondary is black with the cursor being the default X cursor when the mouse pointer is moved on to that screen. Here's my log:

Qt 5.5.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.2.0) on "xcb" 
OS: Arch Linux [linux version 4.1.6-1-ARCH]

Architecture: x86_64; features: SSE2 SSE3 SSSE3 SSE4.1 SSE4.2

Library info:
  PrefixPath: /usr
  DocumentationPath: /usr/share/doc/qt
  HeadersPath: /usr/include/qt
  LibrariesPath: /usr/lib
  LibraryExecutablesPath: /usr/lib/qt/libexec
  BinariesPath: /usr/lib/qt/bin
  PluginsPath: /usr/lib/qt/plugins
  ImportsPath: /usr/lib/qt/imports
  Qml2ImportsPath: /usr/lib/qt/qml
  ArchDataPath: /usr/lib/qt
  DataPath: /usr/share/qt
  TranslationsPath: /usr/share/qt/translations
  ExamplesPath: /usr/share/doc/qt/examples
  TestsPath: /usr/tests
  SettingsPath: /etc/xdg

Standard paths [*...* denote writable entry]:
  DesktopLocation: "Desktop" */home/nektarios/Desktop*
  DocumentsLocation: "Documents" */home/nektarios/Documents*
  FontsLocation: "Fonts" */home/nektarios/.fonts*
  ApplicationsLocation: "Applications" */home/nektarios/.local/share/applications* /usr/share/applications /usr/local/share/applications
  MusicLocation: "Music" */home/nektarios/Music*
  MoviesLocation: "Movies" */home/nektarios/Videos*
  PicturesLocation: "Pictures" */home/nektarios*
  TempLocation: "Temporary Directory" */tmp*
  HomeLocation: "Home" */home/nektarios*
  AppLocalDataLocation: "Application Data" */home/nektarios/.local/share/QtProject/qtdiag* /usr/share/QtProject/qtdiag /usr/local/share/QtProject/qtdiag
  CacheLocation: "Cache" */home/nektarios/.cache/QtProject/qtdiag*
  GenericDataLocation: "Shared Data" */home/nektarios/.local/share* /usr/share /usr/local/share
  RuntimeLocation: "Runtime" */run/user/1002*
  ConfigLocation: "Configuration" */home/nektarios/.config* /etc/xdg
  DownloadLocation: "Download" */home/nektarios*
  GenericCacheLocation: "Shared Cache" */home/nektarios/.cache*
  GenericConfigLocation: "Shared Configuration" */home/nektarios/.config* /etc/xdg
  AppDataLocation: "Application Data" */home/nektarios/.local/share/QtProject/qtdiag* /usr/share/QtProject/qtdiag /usr/local/share/QtProject/qtdiag
  AppConfigLocation: "Application Configuration" */home/nektarios/.config/QtProject/qtdiag* /etc/xdg/QtProject/qtdiag

File selectors (increasing order of precedence):
  en_US unix linux arch

Network:
  Using "OpenSSL 1.0.2d 9 Jul 2015", version: 0x1000204f

Platform capabilities: ThreadedPixmaps OpenGL ThreadedOpenGL WindowMasks MultipleWindows ForeignWindows NonFullScreenWindows NativeWidgets WindowManagement SyncState RasterGLSurface

Style hints:
  mouseDoubleClickInterval: 400
  mousePressAndHoldInterval: 800
  startDragDistance: 4
  startDragTime: 500
  startDragVelocity: 0
  keyboardInputInterval: 400
  keyboardAutoRepeatRate: 30
  cursorFlashTime: 1000
  showIsFullScreen: 0
  passwordMaskDelay: 0
  passwordMaskCharacter: U+25CF
  fontSmoothingGamma: 1
  useRtlExtensions: 0
  setFocusOnTouchRelease: 0
  tabFocusBehavior: Qt::TabFocusBehavior(TabFocusAllControls) 

Theme:
  Styles: qtcurve,breeze,oxygen,fusion,windows
  Icon theme: KFaenza, hicolor from /home/nektarios/.icons,/usr/share/icons,/usr/share/icons
  System font: "Liberation Sans" 10
  General font : "Liberation Sans" 10
  Fixed font   : "Liberation Mono" 10
  Title font   : "Liberation Sans" 11
  Smallest font: "Liberation Sans" 9
  Native file dialog

Screens: 2
# 0 "DVI-I-1" Depth: 24 Primary: yes
  Geometry: 2560x1600+0+0 Available: 2560x1554+0+0
  Virtual geometry: 4480x1600+0+0 Available: 4480x1554+0+0
  2 virtual siblings
  Physical size: 646x406 mm  Refresh: 59 Hz
  Physical DPI: 100.656,100.099 Logical DPI: 91.9903,90.9172
  DevicePixelRatio: 1 Primary orientation: 2
  Orientation: 2 Native orientation: 0 OrientationUpdateMask: 0

# 1 "DVI-D-0" Depth: 24 Primary: no
  Geometry: 1920x1080+2560+260 Available: 1920x1080+2560+260
  Virtual geometry: 4480x1600+0+0 Available: 4480x1554+0+0
  2 virtual siblings
  Physical size: 531x298 mm  Refresh: 119 Hz
  Physical DPI: 91.8418,92.0537 Logical DPI: 91.9903,90.9172
  DevicePixelRatio: 1 Primary orientation: 2
  Orientation: 2 Native orientation: 0 OrientationUpdateMask: 0

LibGL Vendor: NVIDIA Corporation
Renderer: GeForce GTX 760/PCIe/SSE2
Version: 4.5.0 NVIDIA 352.41
Shading language: 4.50 NVIDIA
Format: Version: 4.5 Profile: 2 Swap behavior: 0 Buffer size (RGB): 8,8,8 Depth buffer: 24

@jimmytheneutrino

This comment has been minimized.

Copy link

commented Sep 28, 2015

Hi guys! Not sure if this is related but I got exactly the same visual behaviour on Archlinux running Gnome (so no sddm installed) after upgrading kernel 4.1.6->4.2.1. My external monitor gets detected but stays blank.

Downgrading kernel helps.

Video is Intel® HD Graphics 5500 (Broadwell GT2).

@budimanjojo

This comment has been minimized.

Copy link

commented Sep 28, 2015

I don't think it's kernel related because it doesn't happen on me using other login managers (gdm and lxdm tested)

@simpers

This comment has been minimized.

Copy link

commented Sep 30, 2015

@jimmytheneutrino I had to downgrade my kernel today to even be able to properly login, due to this error. It used to happen only when having my external monitor connected but after upgrading my whole system today (nvidia drivers and kernel were both upgraded), I couldn't do anything. I downgraded said packages, still same behaviour. Decided to downgrade sddm, now I manage to at least login. I have not rebooted yet, as I just stopped, downgraded and then started the service from another tty.

@biergaizi

This comment has been minimized.

Copy link

commented Oct 3, 2015

I don't know if my issue is related, but after upgraded to v0.12, my triple-screen configuration is completely broken on sddm.

Triple Screens Configuration

I'm using NVIDIA proprietary driver with three monitors with different sizes.

Before upgraded to v0.12, my sddm login screen was working flawlessly.

Good Screens

But after upgraded to v0.12, the whole graphics is broken. The login screen has been ripped to shreds, and I'm unable to click the login button.

Bad Screens

While I was hacking the codebase, I've found there is a major changes in 947b8d1, sddm is creating separate windows on different screens, rather than creating a large window cross the screen. But this change causes my regression.

After reverted this commit, sddm returned to the original behaviour in v0.11, and fixed the problem. If anyone wants to workaround the problem for now, just try the patch below.


This reverts commit 947b8d19550df36bb992ba864f9d2f70423e2664.
---
 src/greeter/GreeterApp.cpp  | 80 +++++++++++++--------------------------------
 src/greeter/GreeterApp.h    |  7 ++--
 src/greeter/ScreenModel.cpp |  4 ---
 3 files changed, 25 insertions(+), 66 deletions(-)

diff --git a/src/greeter/GreeterApp.cpp b/src/greeter/GreeterApp.cpp
index 59a48a0..25085ac 100644
--- a/src/greeter/GreeterApp.cpp
+++ b/src/greeter/GreeterApp.cpp
@@ -1,5 +1,4 @@
 /***************************************************************************
-* Copyright (c) 2015 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
 * Copyright (c) 2013 Abdurrahman AVCI <abdurrahmanavci@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify
@@ -76,6 +75,12 @@ namespace SDDM {
         // read theme metadata
         m_metadata = new ThemeMetadata(QStringLiteral("%1/metadata.desktop").arg(m_themePath));

+        // create view
+        m_view = new QQuickView();
+        m_view->setResizeMode(QQuickView::SizeRootObjectToView);
+
+        m_view->engine()->addImportPath(QStringLiteral(IMPORTS_INSTALL_DIR));
+
         // Translations
         // Components translation
         m_components_tranlator = new QTranslator();
@@ -129,74 +134,35 @@ namespace SDDM {

         m_proxy->setSessionModel(m_sessionModel);

-        // create views
-        Q_FOREACH (QScreen *screen, screens())
-            addViewForScreen(screen);
-
-        // handle screens
-        connect(this, &GreeterApp::screenAdded, this, &GreeterApp::addViewForScreen);
-    }
-
-    void GreeterApp::addViewForScreen(QScreen *screen) {
-        // heuristic to detect clone mode, in that case only add a view for the primary screen
-        if (screen->virtualGeometry() == primaryScreen()->geometry() && screen != primaryScreen())
-            return;
-
-        // create view
-        QQuickView *view = new QQuickView();
-        view->setScreen(screen);
-        view->setResizeMode(QQuickView::SizeRootObjectToView);
-        view->setGeometry(QRect(QPoint(0, 0), screen->availableGeometry().size()));
-
-        // remove the view when the screen is removed, but we
-        // need to be careful here since Qt will move the view to
-        // another screen before this signal is emitted so we
-        // pass a pointer to the view to our slot
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0))
-        connect(this, &GreeterApp::screenRemoved, this, [view, this](QScreen *) {
-            removeViewForScreen(view);
-        });
-#else
-        connect(view, &QQuickView::screenChanged, this, [view, this](QScreen *screen) {
-            if (screen == Q_NULLPTR)
-                removeViewForScreen(view);
-        });
-#endif
-
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0))
-        // always resize when the screen geometry changes
-        connect(screen, &QScreen::availableGeometryChanged, this, [view](const QRect &r) {
-            view->setGeometry(r);
-        });
-#endif
-
-        view->engine()->addImportPath(QStringLiteral(IMPORTS_INSTALL_DIR));
-
         // connect proxy signals
-        connect(m_proxy, SIGNAL(loginSucceeded()), view, SLOT(close()));
+        QObject::connect(m_proxy, SIGNAL(loginSucceeded()), m_view, SLOT(close()));

         // set context properties
-        view->rootContext()->setContextProperty(QStringLiteral("sessionModel"), m_sessionModel);
-        view->rootContext()->setContextProperty(QStringLiteral("screenModel"), m_screenModel);
-        view->rootContext()->setContextProperty(QStringLiteral("userModel"), m_userModel);
-        view->rootContext()->setContextProperty(QStringLiteral("config"), *m_themeConfig);
-        view->rootContext()->setContextProperty(QStringLiteral("sddm"), m_proxy);
-        view->rootContext()->setContextProperty(QStringLiteral("keyboard"), m_keyboard);
+        m_view->rootContext()->setContextProperty(QStringLiteral("sessionModel"), m_sessionModel);
+        m_view->rootContext()->setContextProperty(QStringLiteral("screenModel"), m_screenModel);
+        m_view->rootContext()->setContextProperty(QStringLiteral("userModel"), m_userModel);
+        m_view->rootContext()->setContextProperty(QStringLiteral("config"), *m_themeConfig);
+        m_view->rootContext()->setContextProperty(QStringLiteral("sddm"), m_proxy);
+        m_view->rootContext()->setContextProperty(QStringLiteral("keyboard"), m_keyboard);

         // get theme main script
         QString mainScript = QStringLiteral("%1/%2").arg(m_themePath).arg(m_metadata->mainScript());

         // set main script as source
-        view->setSource(QUrl::fromLocalFile(mainScript));
+        m_view->setSource(QUrl::fromLocalFile(mainScript));

-        // show
-        view->show();
+        // connect screen update signals
+        connect(m_screenModel, SIGNAL(primaryChanged()), this, SLOT(show()));
+
+        show();
     }

-    void GreeterApp::removeViewForScreen(QQuickView *view) {
-        m_views.removeOne(view);
-        view->deleteLater();
+    void GreeterApp::show() {
+        m_view->setGeometry(m_screenModel->geometry());
+        m_view->show();
+        m_view->requestActivate();
     }
+
 }

 int main(int argc, char **argv) {
diff --git a/src/greeter/GreeterApp.h b/src/greeter/GreeterApp.h
index 945e041..87ca76f 100644
--- a/src/greeter/GreeterApp.h
+++ b/src/greeter/GreeterApp.h
@@ -1,5 +1,4 @@
 /***************************************************************************
-* Copyright (c) 2015 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
 * Copyright (c) 2013 Nikita Mikhaylov <nslqqq@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify
@@ -22,7 +21,6 @@
 #define GREETERAPP_H

 #include <QGuiApplication>
-#include <QScreen>
 #include <QQuickView>

 class QTranslator;
@@ -49,13 +47,12 @@ namespace SDDM {
         static GreeterApp *instance() { return self; }

     private slots:
-        void addViewForScreen(QScreen *screen);
-        void removeViewForScreen(QQuickView *view);
+        void show();

     private:
         static GreeterApp *self;

-        QList<QQuickView *> m_views;
+        QQuickView *m_view { nullptr };
         QTranslator *m_theme_translator { nullptr },
                     *m_components_tranlator { nullptr };

diff --git a/src/greeter/ScreenModel.cpp b/src/greeter/ScreenModel.cpp
index 392bf4c..a49f31d 100644
--- a/src/greeter/ScreenModel.cpp
+++ b/src/greeter/ScreenModel.cpp
@@ -120,13 +120,9 @@ namespace SDDM {
         return;
 #endif

-        QScreen *primaryScreen = QGuiApplication::primaryScreen();
         QList<QScreen *> screens = QGuiApplication::screens();
         for (int i = 0; i < screens.size(); ++i) {
             QScreen *screen = screens.at(i);
-            // heuristic to detect clone mode, in that case only consider the primary screen
-            if (screen->virtualGeometry() == primaryScreen->geometry() && screen != primaryScreen)
-                continue;
             // add to the screens list
             d->screens << ScreenPtr { new Screen { QStringLiteral("Screen %1").arg(i + 1), screen->geometry() } };
             // extend available geometry
-- 
2.5.3
@plfiorini

This comment has been minimized.

Copy link
Member

commented Oct 15, 2015

Please try with: #511

@plfiorini plfiorini self-assigned this Oct 15, 2015
@plfiorini plfiorini added this to the 0.13 milestone Oct 15, 2015
@psycha0s

This comment has been minimized.

Copy link

commented Oct 15, 2015

The #511 doesn't help, my second screen is black anyway.

@plfiorini

This comment has been minimized.

Copy link
Member

commented Oct 15, 2015

patch updated, i will test it on other systems as well, but it should be better than the firstr iteration

@psycha0s

This comment has been minimized.

Copy link

commented Oct 16, 2015

I've built sddm from the screen branch and now I have login screens on both monitors. I'm able to successfully login when the second monitor is connected, so this patch works for me.

@biergaizi

This comment has been minimized.

Copy link

commented Oct 16, 2015

@plfiorini The patch was tested and it works for me.

@gunzy83

This comment has been minimized.

Copy link

commented Oct 17, 2015

I also tested that branch on my 3 screen setup (2560x1440 flanked by 2x vertical 1920x1080) and I have a login box on each screen rather than the mess I had similar to biergaizi's comment.

@plfiorini

This comment has been minimized.

Copy link
Member

commented Oct 17, 2015

Merge, thanks guys.

@plfiorini plfiorini closed this Oct 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.