13 Commits

Author SHA1 Message Date
Tor Arne Vestbø
88447a0c53 Replace incorrect Metal config check in nativewindow.h
Change-Id: I6d3718d45e55864169cd41694b0cdf16e9bf8f44
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-05-01 14:24:06 +02:00
Tor Arne Vestbø
988039729f QWindow: Persist foreign winId to support destroy/create cycles
We used to set a private _q_foreignWinId property on QWindow when
creating foreign windows, and this was the mechanism which we then
passed the foreign winId to the platform plugin.

With c585802e946d97e7d177ea334a162dc7bc286b84 this was removed,
since we now were passing the winId through via explicit QPA
APIs, and since 0c6911e5cde24c45d6f2c08b6e71064bdd1eccfa removed
the ability to explicitly destroy() a foreign window.

But when closing a QWindow, we destroy both the window itself,
and all its children, including foreign windows. In this case
we still want to support recreating the foreign window, for
example when the parent window is shown again. To enable this
we restore the _q_foreignWinId private property, but keep
the limitation of not being able to explicitly destroy a
foreign window.

Pick-to: 6.7 6.5
Fixes: QTBUG-124160
Change-Id: Ia885ba9f043e64fb21eedd2b4c344679726f1b5c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2024-04-19 14:54:17 +02:00
Tor Arne Vestbø
14ec2ab89f Add configure feature for Metal
Simplifies maintenance of code paths that rely on Metal.

Change-Id: I1d1f705fffc14dbafde346eeb555b43be6d5be54
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-03-19 14:52:48 +01:00
Tasuku Suzuki
bd6d7d4d74 Remove extra semi-colons
Change-Id: I92fddb36cd136fd1bd627955f15d0559b9942d7e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-02-06 20:17:18 +09:00
Lucie Gérard
ff1039c217 Change license for tests files
According to QUIP-18 [1], all tests file should be
LicenseRef-Qt-Commercial OR GPL-3.0-only

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-02-04 09:56:42 +01:00
Volker Hilsheimer
b13c610f50 Don't include windows.h in the public qopengl.h header
All we need are the APIENTRY and WINGDIAPI macros, as those are used
in the gl.h header. Define those locally for the time we need them.

Use a QT_APIENTRY macro instead of hijacking APIENTRY for when we
declare OpenGL functions with the stdcall calling convention.

A few build fixes needed in tests that used Windows types without
explicitly including windows.h first, or that (incorrectly) included
one of the sub-headers of windows.h (like winuser.h).

[ChangeLog][Potentially Source-Incompatible Changes][OpenGL]
On Windows, the public qopengl.h header no longer includes windows.h.

Pick-to: 6.7
Fixes: QTBUG-120687
Change-Id: I3770ac8eaeee5bcf4e7234e5a2539935a8aa5a7d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2024-01-16 14:53:39 +01:00
Tinja Paavoseppä
6ff88f97a6 Android: Add preliminary support for child windows
Update the manual test case for embedded windows to have
native window on Android.

There are still some sharp corners, for example:

* The windows are implemented with SurfaceViews, which makes
  z-ordering with multiple of them a bit tricky. The Surfaces
  they instantiate are basically z-ordered to either be below
  everything, with a hole punched in the window, or on top of
  everything, with the Surfaces created later on top of the
  ones created earlier. Also, with the foreign views it looks
  like the native view is on top of the Surface, because it
  is created later. And since the child windows create their
  Surfaces before the parent, they would be behind the parent
  window, currently circumventing this with letting the
  parent be z-ordered behind everything, and the children
  on top of everything. A follow up commit addresses this by
  changing the native view class to TextureView when multiple
  windows are present.
* Parent window always gets the touch events - fixed in
  a follow up commit
* If a child window has a text edit, it does not receive
  focus when clicking on it

Task-number: QTBUG-116187
Change-Id: I32188ec5e3d3fce9fd8e3a931e317d1e081f691c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-12-08 15:53:37 +02:00
Tor Arne Vestbø
c3a1fe7bd7 Prevent reparenting of foreign window embedding container
A foreign window used to embed a Qt window into it should not end up
with changes to its own parent, as its only job is to give the embedded
Qt window a parent handle.

Pick-to: 6.6
Change-Id: If1bc89658fedf449d266bc0cc750c90b6a841a68
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-11-15 18:25:04 +01:00
Tor Arne Vestbø
3cb3c1d9a8 xcb: Implement native window helper for embeddedwindows/foreign window test
Pick-to: 6.6
Change-Id: I73720f8f49a5d7e5df7c95bf4b17ef910180e01c
Reviewed-by: Liang Qi <liang.qi@qt.io>
2023-09-12 02:47:24 +02:00
Tor Arne Vestbø
be03c9f1d9 Add embeddedwindows manual test
For the child windows we have to use showNormal() explicitly,
as the default window state logic of platforms like iOS does
not have access to the QWindow, only to its flags, and we
can not use Qt::SubWindow as a proxy for being a child window,
as that's a window flag meant to be used for MDI sub windows.

Pick-to: 6.6
Change-Id: I2b5e669f6180ffdcb75479dece38ae5e5430aef6
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-08-07 22:59:19 +02:00
Tor Arne Vestbø
6a633221f3 tests: Add iOS support to nativewindow helper
Pick-to: 6.6
Change-Id: I3e22423734d25acb2ef04d22a1647874c2d10420
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-08-07 22:59:19 +02:00
Tor Arne Vestbø
546d4c9d33 tst_foreignwindow: Add basic test of foreign window reparenting
Pick-to: 6.6
Change-Id: I008fad0f6527503a13ded4818eec5cb280f65cf4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-08-07 17:58:53 +02:00
Tor Arne Vestbø
5e6d46a9f7 tests: Move NativeWindow helper class to shared header
Pick-to: 6.6
Change-Id: Ia7dc54aa761fdfde42d49a41475a4fbc74036aeb
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2023-08-03 16:09:17 +02:00