OSX 10.12, ShowModal Scrolling issues

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

OSX 10.12, ShowModal Scrolling issues

Dion Whittaker
Hi,

I am updating my application from wxWidgets 3.0.2 to 3.1.0 and have
noticed some scrolling issues on both wxListCtrl and wxDataViewCtrl -
using the trackpad on a mac book. If you scroll at a reasonably fast
speed the scrolling is jerky and intermittent with a significant delay
between the scrolling action and the scroll. The scrolling isn't smooth
as you would expect, the scroll cursor jumps from position to position.
Some of the scrolling windows are basically unusable.

After some investigation I have discovered the following:
- The jerky scrolling only occurs when ShowModal() is used to display
the dialog. Using Show() the scrolling is smooth.
- I am using OSX 10.12.4. I tested on OSX 10.10 and the problem didn't
occur.
- It doesn't matter if the listbox is virtual or not
- You can get the issue to occur using the XRC sample program. Add the
following lines to the myframe.cpp file in the xrc sample to give enough
items to enable the window to scroll. It updates the wxListCtrl example
in the controls example.

 >  list->InsertItem(0, "Athos", 0);   list->SetItem(0, 1, "90", 2);
 >  list->InsertItem(1, "Porthos", 5); list->SetItem(1, 1, "120", 3);
 >  list->InsertItem(2, "Aramis", 1);  list->SetItem(2, 1, "80", 4);    
                     // Line 241

+    for(int x = 3; x < 200; x++)
+    {
+       list->InsertItem(x, "Item", 0);
+       list->SetItem(x, 1, "90", 2);
+    }

I am using XCode 8.3.2 on OSX 10.12.4 using the 10.12 SDK.
It may or may not be a 3.0.2->3.1.0 issue as I have also updated the
compiler and SDK. I am going to try and compile 3.0.2 with the new tools
and see if the issue still occurs.

If someone can point me in the right direction I can take a look and see
if I can figure out what might be going on.
Regards
Dion

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: OSX 10.12, ShowModal Scrolling issues

oneeyeman
Hi,

On Fri, Apr 28, 2017 at 9:44 AM, Dion Whittaker <[hidden email]> wrote:
> Hi,
>
> I am updating my application from wxWidgets 3.0.2 to 3.1.0 and have noticed
> some scrolling issues on both wxListCtrl and wxDataViewCtrl - using the
> trackpad on a mac book. If you scroll at a reasonably fast speed the
> scrolling is jerky and intermittent with a significant delay between the
> scrolling action and the scroll. The scrolling isn't smooth as you would
> expect, the scroll cursor jumps from position to position. Some of the
> scrolling windows are basically unusable.

How did you configure the library?
Thank you.

>
> After some investigation I have discovered the following:
> - The jerky scrolling only occurs when ShowModal() is used to display the
> dialog. Using Show() the scrolling is smooth.
> - I am using OSX 10.12.4. I tested on OSX 10.10 and the problem didn't
> occur.
> - It doesn't matter if the listbox is virtual or not
> - You can get the issue to occur using the XRC sample program. Add the
> following lines to the myframe.cpp file in the xrc sample to give enough
> items to enable the window to scroll. It updates the wxListCtrl example in
> the controls example.
>
>>  list->InsertItem(0, "Athos", 0);   list->SetItem(0, 1, "90", 2);
>>  list->InsertItem(1, "Porthos", 5); list->SetItem(1, 1, "120", 3);
>>  list->InsertItem(2, "Aramis", 1);  list->SetItem(2, 1, "80", 4);
>> // Line 241
>
> +    for(int x = 3; x < 200; x++)
> +    {
> +       list->InsertItem(x, "Item", 0);
> +       list->SetItem(x, 1, "90", 2);
> +    }
>
> I am using XCode 8.3.2 on OSX 10.12.4 using the 10.12 SDK.
> It may or may not be a 3.0.2->3.1.0 issue as I have also updated the
> compiler and SDK. I am going to try and compile 3.0.2 with the new tools and
> see if the issue still occurs.
>
> If someone can point me in the right direction I can take a look and see if
> I can figure out what might be going on.
> Regards
> Dion
>
> --
> Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
>
> To unsubscribe, send email to [hidden email]
> or visit http://groups.google.com/group/wx-users

--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re: OSX 10.12, ShowModal Scrolling issues

Dion Whittaker
In reply to this post by Dion Whittaker
On 28/4/17 9:44 pm, Dion Whittaker wrote:

> Hi,
>
> I am updating my application from wxWidgets 3.0.2 to 3.1.0 and have
> noticed some scrolling issues on both wxListCtrl and wxDataViewCtrl -
> using the trackpad on a mac book. If you scroll at a reasonably fast
> speed the scrolling is jerky and intermittent with a significant delay
> between the scrolling action and the scroll. The scrolling isn't
> smooth as you would expect, the scroll cursor jumps from position to
> position. Some of the scrolling windows are basically unusable.
>
> After some investigation I have discovered the following:
> - The jerky scrolling only occurs when ShowModal() is used to display
> the dialog. Using Show() the scrolling is smooth.
> - I am using OSX 10.12.4. I tested on OSX 10.10 and the problem didn't
> occur.
> - It doesn't matter if the listbox is virtual or not
> - You can get the issue to occur using the XRC sample program. Add the
> following lines to the myframe.cpp file in the xrc sample to give
> enough items to enable the window to scroll. It updates the wxListCtrl
> example in the controls example.
>
> >  list->InsertItem(0, "Athos", 0);   list->SetItem(0, 1, "90", 2);
> >  list->InsertItem(1, "Porthos", 5); list->SetItem(1, 1, "120", 3);
> >  list->InsertItem(2, "Aramis", 1);  list->SetItem(2, 1, "80", 4);    
>                     // Line 241
>
> +    for(int x = 3; x < 200; x++)
> +    {
> +       list->InsertItem(x, "Item", 0);
> +       list->SetItem(x, 1, "90", 2);
> +    }
>
> I am using XCode 8.3.2 on OSX 10.12.4 using the 10.12 SDK.
> It may or may not be a 3.0.2->3.1.0 issue as I have also updated the
> compiler and SDK. I am going to try and compile 3.0.2 with the new
> tools and see if the issue still occurs.
>
> If someone can point me in the right direction I can take a look and
> see if I can figure out what might be going on.
> Regards
> Dion
>
After checking I found the issue also occurred using 3.0.2 when
compiling with the latest SDK (10.12) and compilers.

I traced though the code, and found the issue was in the function
wxGUIEventLoop::DoDispatchTimeout() in src/osx/cocoa/evtloop.mm.

The problem seemed to be that the call to
[[NSApplication sharedApplication]
nextEventMatchingMask: NSAnyEventMask
untilDate: [NSDatedateWithTimeIntervalSinceNow : timeout/1000.0
inMode: NSDefaultRunLoopMode
dequeue: NO]

was blocking under OSX 10.12 when compiled with the 10.12 SDK, where it
wasn't under other OS X versions.

I checked the trunk and this section of code had been updated already. I
compiled the trunk version and the problem didn't re-occur (should've
tried this first). I backported the changes to the DoDispatchTimeout
function to the 3.1.0 code and the scrolling worked fine in the dialogs
on both OSX 10.12 and 10.10.

So the upshot is, if you experience scrolling issues in modal dialogs on
OSX 10.12 either switch to using the trunk code or backport the changes
in wxGUEventLoop::DoDispatchTimeout() in src/osx/cocoa/evtloop.mm.

Thanks to everyone for all their hard work on wxWidgets.
Dion


--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to [hidden email]
or visit http://groups.google.com/group/wx-users
Reply | Threaded
Open this post in threaded view
|

Re[2]: OSX 10.12, ShowModal Scrolling issues

Vadim Zeitlin-4
On Tue, 2 May 2017 21:15:52 +0800 Dion Whittaker wrote:

DW> After checking I found the issue also occurred using 3.0.2 when
DW> compiling with the latest SDK (10.12) and compilers.
DW>
DW> I traced though the code, and found the issue was in the function
DW> wxGUIEventLoop::DoDispatchTimeout() in src/osx/cocoa/evtloop.mm.
DW>
DW> The problem seemed to be that the call to
DW> [[NSApplication sharedApplication]
DW> nextEventMatchingMask: NSAnyEventMask
DW> untilDate: [NSDatedateWithTimeIntervalSinceNow : timeout/1000.0
DW> inMode: NSDefaultRunLoopMode
DW> dequeue: NO]
DW>
DW> was blocking under OSX 10.12 when compiled with the 10.12 SDK, where it
DW> wasn't under other OS X versions.
DW>
DW> I checked the trunk and this section of code had been updated already. I
DW> compiled the trunk version and the problem didn't re-occur (should've
DW> tried this first). I backported the changes to the DoDispatchTimeout
DW> function to the 3.1.0 code and the scrolling worked fine in the dialogs
DW> on both OSX 10.12 and 10.10.

 It would be great if you could please your patch and/or make a PR on
GitHub with your changes, so that we could apply them for 3.0.4 (as,
unfortunately, it's just too late for 3.0.3).

DW> Thanks to everyone for all their hard work on wxWidgets.

 Thank you!
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/

attachment0 (203 bytes) Download Attachment