OmixVisualization / qtjambi

QtJambi is a wrapper for using Qt in Java.
http://www.qtjambi.io
Other
354 stars 40 forks source link

[BUG] Window decorations missing on GNOME 46 Wayland (Fedora 40 Silverblue) #205

Closed ghost closed 2 months ago

ghost commented 2 months ago

Describe the bug When creating a QMainWindow, decorations such as the [_][ ][ X ] are missing from the window, even after setting the flags.

To Reproduce Steps to reproduce the behavior:

  1. Call QApplication.initialize(...) with empty arguments.
  2. Create a QMainWindow instance, call these flags:
    Qt.WindowType.Window
    Qt.WindowType.WindowMinMaxButtonsHint
    Qt.WindowType.WindowCloseButtonHint
  3. Run the application by calling QApplication.exec

Expected behavior I should have my three decoration buttons.

Screenshots image

System (please complete the following information):

Additional context MyWindow.scala

object MyWindow extends QMainWindow:
  this.setBaseSize(640, 480)

  this.setWindowTitle("Example")
  this.setWindowFlags(
    Qt.WindowType.Window,
    Qt.WindowType.WindowMinMaxButtonsHint,
    Qt.WindowType.WindowCloseButtonHint
  )

Main.scala

object Main extends App:
  QApplication.initialize(Array.empty)

  val window = MyWindow
  window.show

  QApplication.exec
end Main

build.sbt

// ...
libraryDependencies ++= {
  val qtjambiVersion = "5.15.20"

  Seq(
    "io.qtjambi" % "qtjambi" % qtjambiVersion,
    "io.qtjambi" % "qtjambi-native-linux-x64" % qtjambiVersion
    // "io.qtjambi" % "qtjambi-native-macos" % qtjambiVersion,
    // "io.qtjambi" % "qtjambi-native-windows-arm64" % qtjambiVersion,
    // "io.qtjambi" % "qtjambi-native-windows-x64" % qtjambiVersion
  )
}
omix commented 2 months ago

I am not able to reproduce this behavior. However I tried it Java not Scala, on Ubuntu not Fedora, with Qt 5.15.13 not 5.15.14. This is most likely not a QtJambi bug. Either it is a matter of addressing the methods from Scala or of Qt on your system. What happens if you start the application with argument -platform xcb?

ghost commented 2 months ago

I am not able to reproduce this behavior. However I tried it Java not Scala, on Ubuntu not Fedora, with Qt 5.15.13 not 5.15.14. This is most likely not a QtJambi bug. Either it is a matter of addressing the methods from Scala or of Qt on your system. What happens if you start the application with argument -platform xcb?

It seems that -platform xcb solves the problem with the decorations.

I don't think you'd be able to reproduce this issue if you deliberately choose not to use identical configuration to set it up, like using Scala over Java (despite being JVM) oder a RedHat-based distribution of Linux.

EDIT: You do however lose out on HiDPI scaling, so now you'd have to deliberately resize the window twice to get the exact same resolution you'd get if it was properly scaled. Perhaps this ist a bug with GNOME Wayland on certain distributions, oder a bug with Qt itself?

omix commented 2 months ago

I am not able to reproduce this behavior. However I tried it Java not Scala, on Ubuntu not Fedora, with Qt 5.15.13 not 5.15.14. This is most likely not a QtJambi bug. Either it is a matter of addressing the methods from Scala or of Qt on your system. What happens if you start the application with argument -platform xcb?

It seems that -platform xcb solves the problem with the decorations.

I don't think you'd be able to reproduce this issue if you deliberately choose not to use identical configuration to set it up, like using Scala over Java (despite being JVM) oder a RedHat-based distribution of Linux.

Yes I agree. However I don't have you configuration available on the fly. Since Xcb behaves as expected I think it's something between Qt and Wayland or specific to Fedora. I suggest to search specific Qt forums for this issue.

In general, you don't need to set window flags at all to let min/max/close appear. It shows up by default.

ghost commented 2 months ago

I am not able to reproduce this behavior. However I tried it Java not Scala, on Ubuntu not Fedora, with Qt 5.15.13 not 5.15.14. This is most likely not a QtJambi bug. Either it is a matter of addressing the methods from Scala or of Qt on your system. What happens if you start the application with argument -platform xcb?

It seems that -platform xcb solves the problem with the decorations. I don't think you'd be able to reproduce this issue if you deliberately choose not to use identical configuration to set it up, like using Scala over Java (despite being JVM) oder a RedHat-based distribution of Linux.

Yes I agree. However I don't have you configuration available on the fly. Since Xcb behaves as expected I think it's something between Qt and Wayland or specific to Fedora. I suggest to search specific Qt forums for this issue.

In general, you don't need to set window flags at all to let min/max/close appear. It shows up by default.

I think for now, the issue ist solved. I shall go ask the Qt community around if they know anything about this issue because now it'st definitely an issue with Qt und GNOME (oder Fedora too) und not this library.