Re: [Interest] Bug in QCodoaWindow?

2020-08-28 Thread Tor Arne Vestbø

> On 27 Aug 2020, at 23:36, j...@wavemetrics.com wrote:
> 
> I was primed to find something wrong: I've been getting what as far as I can 
> tell are bad window state change events telling me that a window is maximized 
> when it isn't. Plays dicky with certain parts of my code!

Do you have a bug report with a reduced/minimal test case?

Tor Arne 
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Bug in QCodoaWindow?

2020-08-27 Thread john
Thanks, Andy. You're quite right. Now I'm trying to think about troubles I've 
had that require parens, and can't remember... Maybe I was mixing bitwise & and 
bitwise | (or). And certainly it's easy to write buggy code mixing && and ||.

I was primed to find something wrong: I've been getting what as far as I can 
tell are bad window state change events telling me that a window is maximized 
when it isn't. Plays dicky with certain parts of my code!

> On Aug 27, 2020, at 2:25 PM, Andy  wrote:
> 
> Bitwise "&" has precedence over logical "&&", so I think this is alright.
> 

-John Weeks

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] Bug in QCodoaWindow?

2020-08-27 Thread Andy
Bitwise "&" has precedence over logical "&&", so I think this is alright.

https://en.cppreference.com/w/cpp/language/operator_precedence

(Regardless I would always use parens in cases like this to make it easier
for humans reading the code.)

---
Andy Maloney  //  https://asmaloney.com
twitter ~ @asmaloney 



On Thu, Aug 27, 2020 at 5:17 PM John Weeks  wrote:

> Isn't this a bug?
>
>  bool QCocoaWindow::isTransitioningToFullScreen() const
> {
> NSWindow *window = m_view.window;
> return window.styleMask & NSWindowStyleMaskFullScreen &&
> !window.qt_fullScreen;
> }
>
> Seems like the bitwise & needs parens.
>
> This is from Qt 5.12.9. Haven't checked Qt 5.15.
>
> -John Weeks
> WaveMetrics, Inc.
>
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] Bug in QCodoaWindow?

2020-08-27 Thread John Weeks
Isn't this a bug?

 bool QCocoaWindow::isTransitioningToFullScreen() const
{
NSWindow *window = m_view.window;
return window.styleMask & NSWindowStyleMaskFullScreen && 
!window.qt_fullScreen;
}

Seems like the bitwise & needs parens.

This is from Qt 5.12.9. Haven't checked Qt 5.15.

-John Weeks
WaveMetrics, Inc.

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest