Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

5.3 #1500

r0x0r started this conversation in General
5.3 #1500
Oct 16, 2024 · 1 comments · 1 reply
Discussion options

⚡ Features

  • All Native window object for each platform is now exposed window.native. You can use it for example for applying custom appearance to a window. Additionally WebView is exposed via window.native.webview
  • All New window.events.before_show event.
  • All New DomEventHandler debounce parameter. It can be used it for solving performance issues with dragover and mouseover events.
  • GTK/QT application icon support for GTK and QT platforms webview.start(icon=<path>)

🚀 Improvements

  • All Storage path is now verified for write permissions before application start. An exception is thrown, if path is not writable.
  • All Refined logic at which point of the startup procedure shown event is fired.
  • Cocoa Better handling of stopping event loop in headless environments.
  • Windows Fallback to WinForms when QT is forced and not available
  • Windows Remove white border in a fullscreen window.
  • Windows Support multiple selection in open folder dialog.

🐞 Bug fixes

  • All Support for Unicode filenames in drag and drop. Thanks @hustshenl
  • Cocoa Fix open file dialog file type selector and all files filter
  • Cocoa Fix folder drag and drop. Thanks @pythons
  • GTK Fix multiple file drag and drop on certain Linux distributions. Thanks @coffeejunk
  • QT QT6 compatilibity
  • QT Release of profile requested but WebEnginePage still not deleted with multiple windows
  • Windows Graceful handling for shcore.dll not being present on Windows 7. Thanks @rafael-vasconcellos.
  • Windows Return result of open folder dialog is fixed to tuple.
  • Edge Chromium Current url not being updated after a navigation event. Thanks @hustshenl

This discussion was created from the release 5.3.
You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

img_v3_02gv_fa96f985-0d2b-4117-95e8-502fefe8694g

@r0x0r how to custom window appearance, would u give a simple example?

You must be logged in to vote
1 reply
Comment options

r0x0r Nov 26, 2024
Maintainer Author

Here is a simple example on how to enable dark mode on Windows 11.

import webview
import ctypes
from ctypes import wintypes
DWMWA_USE_IMMERSIVE_DARK_MODE = 20 # Windows 11 specific attribute
user32 = ctypes.WinDLL("user32", use_last_error=True)
dwmapi = ctypes.WinDLL("dwmapi", use_last_error=True)
def on_before_show(window):
 print('Native window object', window.native)
 value = ctypes.c_int(1) # Enable dark mode (0 to disable)
 dwmapi.DwmSetWindowAttribute(
 wintypes.HWND(window.native.Handle.ToInt32()),
 DWMWA_USE_IMMERSIVE_DARK_MODE,
 ctypes.byref(value),
 ctypes.sizeof(value)
 )
if __name__ == '__main__':
 window = webview.create_window(
 'Simple browser', 'https://pywebview.flowrl.com/'
 )
 window.events.before_show += on_before_show
 webview.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants

AltStyle によって変換されたページ (->オリジナル) /