iterate-ch / cyberduck

Cyberduck is a libre FTP, SFTP, WebDAV, Amazon S3, Backblaze B2, Microsoft Azure & OneDrive and OpenStack Swift file transfer client for Mac and Windows.
https://cyberduck.io/
GNU General Public License v3.0
3k stars 274 forks source link

Modernize Transfers-window #15885

Open AliveDevil opened 3 weeks ago

AliveDevil commented 3 weeks ago

This is an ongoing effort to improve the resource usage of Cyberduck on Windows.

Addresses:

In switching the UI stack from WinForms (currently) to WPF, we gain the ability to reduce our resource usage dramatically, by not requiring a window handle for each and every single control in the transfers window. Instead there is only one window handle allocated for the entire window, everything else is done in software. A welcome side-effect of this is the offload of rendering to the GPU, reducing the software-rendering requirements of WinForms.

With this, the foundation (controller-architecture) is switching to a view-model based approach, allowing an easier transition to another UI framework in the future.

WPF Limitations as outlined in #13036 apply.

Workaround

The Microsoft documentation provides more information on this issue:

User interface objects support only one handle per object. Processes cannot inherit or duplicate handles to user objects. Processes in one session cannot reference a user handle in another session.

There is a theoretical limit of 65,536 user handles per session. However, the maximum number of user handles that can be opened per session is usually lower, since it is affected by available memory. There is also a default per-process limit of user handles.

You can try to solve the issue by increasing the maximum number of user object handles if deleting the Transfers folder doesn't have any effect. Please follow the steps below to do that:

  1. Use the shortcut Win R to open the search box, type regedit, and open the Registry Editor
  2. Copy the following line into the address bar Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows
  3. Double-click on the entry USERProcessHandleQuota and increase the maximum number of user handlers. Note: The value must be set to a number between 200 and 18000.
  4. Restart the device
Tampa commented 2 weeks ago

Will this also finally enable a way to introduce a dark mode?

AliveDevil commented 2 weeks ago

Adding a single dark-mode aware window to Cyberduck won't make much sense.

Besides, the targeted framework for this window won't magically enable dark-mode as it's been released back in 2006, and Microsoft never spent any time backporting Windows platform features back to it, but invented new UI frameworks.