Skip to content

Commit 19dd961

Browse files
authored
X11: Fix flickering when resizing with transparency enabled (#546)
* X11: Fix flickering when resizing with transparency enabled * X11: Fix with_override_redirect
1 parent bf413ec commit 19dd961

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
- On X11, the `Moved` event is no longer sent when the window is resized without changing position.
44
- `MouseCursor` and `CursorState` now implement `Default`.
55
- `WindowBuilder::with_resizable` implemented for Windows.
6-
- On X11, if width or height is reported as 0, the DPI is now 1.0 instead of +inf.
6+
- On X11, if the monitor's width or height in millimeters is reported as 0, the DPI is now 1.0 instead of +inf.
77
- On X11, the environment variable `WINIT_HIDPI_FACTOR` has been added for overriding DPI factor.
8+
- On X11, enabling transparency no longer causes the window contents to flicker when resizing.
9+
- On X11, `with_override_redirect` now actually enables override redirect.
810

911
# Version 0.15.0 (2018-05-22)
1012

src/platform/linux/x11/window.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,12 @@ impl UnownedWindow {
102102
| ffi::ButtonReleaseMask
103103
| ffi::PointerMotionMask;
104104
swa.border_pixel = 0;
105-
if window_attrs.transparent {
106-
swa.background_pixel = 0;
107-
}
108-
swa.override_redirect = 0;
105+
swa.override_redirect = pl_attribs.override_redirect as c_int;
109106
swa
110107
};
111108

112109
let mut window_attributes = ffi::CWBorderPixel | ffi::CWColormap | ffi::CWEventMask;
113110

114-
if window_attrs.transparent {
115-
window_attributes |= ffi::CWBackPixel;
116-
}
117-
118111
if pl_attribs.override_redirect {
119112
window_attributes |= ffi::CWOverrideRedirect;
120113
}

0 commit comments

Comments
 (0)