paulm
paulm

Reputation: 5892

Qt QDialog and GNOME 3, how to display the close button/title bar and make it movable?

In GNOME 3 when displaying any QDialog it appears that it can't be moved and it has no title bar.

Is there a way to re-enable the title bar and make it movable? I attempted to use a QMainWindow as a workaround instead but it appears in the task bar and won't appear as a "modal" dialog.

Upvotes: 2

Views: 2166

Answers (2)

rdiachenko
rdiachenko

Reputation: 763

Probably, it might help you:

  1. Install Configuration Editor (dconf-editor)
  2. Open it: Alt+F2, enter dconf-editor, press Enter
  3. Go to: /org/gnome/shell/overrides and select attach_modal_dialogs
  4. Change Use default value to OFF
  5. Change Custom value to False

enter image description here

Type r in Alt+F2 prompt to restart Gnome shell and see the changes (QDialogs should become movable).

Upvotes: 3

Andrew
Andrew

Reputation: 836

When I had this problem with a dialog (at least the no title bar part), I fixed the issue by setting the dialog's parent to be nullptr as opposed to setting a real parent.

http://blog.pitonyak.org/node/18

Now, that said, setting the configuration option in gnome is probably a better solution if it works (and I did not verify it). My only complaint with the solution is that then it will behave differently on another computer. Then again, one could argue that the point of having the configuration option is that the owner of that machine can decide.

Upvotes: 0

Related Questions