Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • K KXMLGUI
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Service Desk
    • Milestones
  • Bugzilla
    • Bugzilla
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Frameworks
  • KXMLGUI
  • Merge requests
  • !53

Merged
Created Apr 20, 2021 by Nate Graham@ngrahamDeveloper

Fix initial window size calculations

  • Overview 28
  • Commits 1
  • Changes 1

KMainWindow::applyMainWindowSettings() currently does resize(windowHandle()->size()); unconditionally, but that will always return 640x480. As a result, all KXMLGUI-using apps will get an initial main window size of 640x480, overriding whatever size hint they might have set. This yields an unpolished first impression to the new user due to windows being too small the first time apps are launched.

Various apps have been working around this by adding an initial resize() call to their main window code, which is not super desirable, as it amounts to clients working around a workaround in frameworks.

In order to avoid negative consequences from this workaround, we need to set the newly-created window to have the geometry of the existing widget, which ensures that its sizeHint is applied properly.

cc @dfaure @davidhurka

This can be tested by removing all width and height related values in the [MainWindow] section of ~/.config/okularrc and then launching Okular. The main window should be nice and big, not super tiny.

Edited Apr 23, 2021 by Nate Graham
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: fix-initial-window-size