Skip to content
GitLab
Projects Groups Topics 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
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Service Desk
    • Milestones
  • Bugzilla
    • Bugzilla
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • 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
  • FrameworksFrameworks
  • KXMLGUI
  • Merge requests
  • !53

Fix initial window size calculations

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Nate Graham requested to merge ngraham/kxmlgui:fix-initial-window-size into master Apr 20, 2021
  • Overview 28
  • Commits 1
  • Pipelines 0
  • 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
Reviewers
Request review from
Time tracking
Source branch: fix-initial-window-size