[Development] Conditionally use xcb (or Xlib) in tst_qwindow.cpp?

2017-01-25 Thread Thomas Søndergaard
Hi,

I can see there is code in tests that depending on e.g. Q_OS_WIN32 and
Q_OS_UNIX conditionally includes, for the platform, universally available
headers like . I would like to add a unit test that requires
checking state on the native window behind QWindow. Doing this on windows
with Q_OS_WIN32 should be fine, but how do I make the corresponding test
that requires a bit of XCB/Xlib code?

Specifically I would like to add a test to tst_qwindow.cpp and perhaps
tst_qwidget.cpp that check that the window state (minimized, maximized,
fullscreen) on the native window is what we expect it to be.

Regards,
Thomas
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


[Development] Why doesn't xcb platform plugin use _NET_WM_STATE_HIDDEN?

2017-01-23 Thread Thomas Søndergaard
Why doesn't the XCB platform plugin use _NET_WM_STATE_HIDDEN? There are a
number of bugs related to it QTBUG-31117, QTBUG-39376, QTBUG-34430 and the
commit that address them (commit 382b7afbe253) uses the old WM_STATE.

I am looking at this because I'm trying to fix QTBUG-57882 which is about
the lack of support for setting the full window state on the native window
from Qt, so the programmer cannot programmatically set both minimized and
maximized state on a window at the same time, despite that being a
perfectly valid thing to do.

Thomas
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] QWidget::setWindowState(Qt::WindowStates) vs QWindow::setWindowState(Qt::WindowState)

2017-01-19 Thread Thomas Søndergaard
Hi Bo

On Thu, 19 Jan 2017 at 09.25, Bo Thorsen  wrote:

> Hej Thomas
>

> [...]


> You ask for the best way to proceed: As usual with issues like this, you
>
> should enter a bug in the bug tracker.
>
I did, QTBUG-57882. See original post.

Thomas
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] QWidget::setWindowState(Qt::WindowStates) vs QWindow::setWindowState(Qt::WindowState)

2017-01-18 Thread Thomas Søndergaard
I hope my previous email wasn't offensive or downright stupid; no one has
replied. I certainly meant no disrespect. While I'm waiting for a response,
let me throw a specific proposal out there.

First, I assume the correct solution is to extend QWindow and
QPlatformWindow so they can deal with compound states such as
Qt::WindowMaximized|Qt::WindowMinimized, just like QWidget can. Since
QWindow::setWindowState(Qt::WindowState) and Qt::WindowState
QWindow::windowState() cannot be modified, I'm thinking of adding

Qt::WindowStates QWindow::fullWindowState() const;
void QWindow::setFullWindowState(Qt::WindowStates);

and

Qt::WindowStates QPlatformWindow::fullWindowState() const;
void QPlatformWindow::setFullWindowState(Qt::WindowStates);

The existing QWindow::windowState() would then be implemented using the
effectiveState() function from qwidget.cpp (I'd move it over)

I can experiment with these changes and implementing them in the xcb and
windows platform plugins, but early feedback is always great, so I avoid
wasting time.

Thanks for making Qt

Thomas




On 17 January 2017 at 21:37, Thomas Søndergaard <
thomas.sonderga...@karoshealth.com> wrote:

> Hi,
>
> I'm looking at the Qt code with intention to fix it so this code
>
> QWidget widget;
> widget.setWindowState(Qt::WindowMaximized);
> widget.showMinized();
>
> will show the window iconified and when the user (or program) unminimize
> the window it pops up maximized. This is currently not possible (
> QTBUG-57882 <https://bugreports.qt.io/browse/QTBUG-57882>).
>
> I've been trying to read the Qt code and it seems to me the problem is
> that QWindow::setWindowState(Qt::WindowState) and QPlatformWindow::
> setWindowState(Qt::WindowState) only take a Qt::WindowState argument not
> a Qt::WindowStates argument. This seems to make it impossible to set the
> correct state on the windows-system window.
>
> Is this intentional or a known issue?
>
> I would be happy to get suggestions for how this is best fixed.
>
> Best regards,
> Thomas
>



-- 

Thomas Sondergaard | karoshealth

Product Architect


M: +45 5157 3090 | Skype: tsondergaard


Krumtappen 4, 3rd floor

DK-2500 Valby, Denmark
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


[Development] QWidget::setWindowState(Qt::WindowStates) vs QWindow::setWindowState(Qt::WindowState)

2017-01-17 Thread Thomas Søndergaard
Hi,

I'm looking at the Qt code with intention to fix it so this code

QWidget widget;
widget.setWindowState(Qt::WindowMaximized);
widget.showMinized();

will show the window iconified and when the user (or program) unminimize
the window it pops up maximized. This is currently not possible (QTBUG-57882
).

I've been trying to read the Qt code and it seems to me the problem is that
QWindow::setWindowState(Qt::WindowState) and
QPlatformWindow::setWindowState(Qt::WindowState) only take a
Qt::WindowState argument not a Qt::WindowStates argument. This seems to
make it impossible to set the correct state on the windows-system window.

Is this intentional or a known issue?

I would be happy to get suggestions for how this is best fixed.

Best regards,
Thomas
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development