mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-30 22:25:12 +00:00
Fix bad window rendering with maximize-on-launch.
I have no idea why MainWindow is ruined completely in case you call MainWindow::show, MainWindow::setWindowState(maximized) and then in the same context (without crl::on_main) create full screen viewer.
This commit is contained in:
@@ -455,7 +455,7 @@ void MainWindow::LibsLoaded() {
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::psFirstShow() {
|
||||
void MainWindow::initTrayMenuHook() {
|
||||
const auto trayAvailable = IsSNIAvailable()
|
||||
|| QSystemTrayIcon::isSystemTrayAvailable();
|
||||
|
||||
@@ -490,30 +490,6 @@ void MainWindow::psFirstShow() {
|
||||
LOG(("Not using Unity Launcher count."));
|
||||
}
|
||||
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||
|
||||
show();
|
||||
if (cWindowPos().maximized) {
|
||||
DEBUG_LOG(("Window Pos: First show, setting maximized."));
|
||||
setWindowState(Qt::WindowMaximized);
|
||||
}
|
||||
|
||||
if ((cLaunchMode() == LaunchModeAutoStart && cStartMinimized())
|
||||
|| cStartInTray()) {
|
||||
// If I call hide() synchronously here after show() then on Ubuntu 14.04
|
||||
// it will show a window frame with transparent window body, without content.
|
||||
// And to be able to "Show from tray" one more hide() will be required.
|
||||
crl::on_main(this, [=] {
|
||||
setWindowState(Qt::WindowMinimized);
|
||||
if (Global::WorkMode().value() == dbiwmTrayOnly
|
||||
|| Global::WorkMode().value() == dbiwmWindowAndTray) {
|
||||
hide();
|
||||
} else {
|
||||
show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
setPositionInited();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow() {
|
||||
|
@@ -24,8 +24,6 @@ class MainWindow : public Window::MainWindow {
|
||||
public:
|
||||
explicit MainWindow(not_null<Window::Controller*> controller);
|
||||
|
||||
void psFirstShow();
|
||||
|
||||
virtual QImage iconWithCounter(
|
||||
int size,
|
||||
int count,
|
||||
@@ -43,6 +41,7 @@ public slots:
|
||||
protected:
|
||||
void unreadCounterChangedHook() override;
|
||||
|
||||
void initTrayMenuHook() override;
|
||||
bool hasTrayIcon() const override;
|
||||
|
||||
void workmodeUpdated(DBIWorkMode mode) override;
|
||||
|
Reference in New Issue
Block a user