From f8b69c1fac54fd85e444f77320de91fb81b6e280 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 7 Jun 2016 20:23:29 +0900 Subject: [PATCH] Implement SetIgnoreMouseEvents for Linux --- atom/browser/native_window_views.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/atom/browser/native_window_views.cc b/atom/browser/native_window_views.cc index 6b16072f6adb..29c4187a124c 100644 --- a/atom/browser/native_window_views.cc +++ b/atom/browser/native_window_views.cc @@ -680,6 +680,15 @@ void NativeWindowViews::SetIgnoreMouseEvents(bool ignore) { else ex_style &= ~(WS_EX_TRANSPARENT | WS_EX_LAYERED); ::SetWindowLong(GetAcceleratedWidget(), GWL_EXSTYLE, ex_style); +#elif defined(USE_X11) + if (ignore) { + XRectangle r = {0, 0, 1, 1}; + XShapeCombineRectangles(gfx::GetXDisplay(), GetAcceleratedWidget(), + ShapeInput, 0, 0, &r, 1, ShapeSet, YXBanded); + } else { + XShapeCombineMask(gfx::GetXDisplay(), GetAcceleratedWidget(), + ShapeInput, 0, 0, None, ShapeSet); + } #endif }