diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-04-27 15:54:12 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-04-27 16:17:58 +0200 |
commit | f13523709d8a345c5e54fb54aa08751b3969b4c4 (patch) | |
tree | 854c21e34f6240090c8c6f2110d37159f36a4844 | |
parent | ImageView: Default to transparent background (diff) | |
download | wireguard-windows-f13523709d8a345c5e54fb54aa08751b3969b4c4.tar.xz wireguard-windows-f13523709d8a345c5e54fb54aa08751b3969b4c4.zip |
window: allow setting double buffering
This might be useful for reducing flicker on some complex controls.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | window.go | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -185,6 +185,10 @@ type Window interface { // SetCursor sets the Cursor of the Window. SetCursor(value Cursor) + // SetDoubleBuffering enables or disables double buffering of the + // drawing, which may help reduce flicker. + SetDoubleBuffering(value bool) error + // SetEnabled sets if the Window is enabled for user interaction. SetEnabled(value bool) @@ -766,6 +770,12 @@ func (wb *WindowBase) SetCursor(value Cursor) { wb.cursor = value } +// SetDoubleBuffering enables or disables double buffering of the +// drawing, which may help reduce flicker. +func (wb *WindowBase) SetDoubleBuffering(enabled bool) error { + return wb.ensureExtendedStyleBits(win.WS_EX_COMPOSITED, enabled) +} + // Enabled returns if the *WindowBase is enabled for user interaction. func (wb *WindowBase) Enabled() bool { return wb.enabled |