Fix CreateWindow attributes

; Also fix various compile warnings.

* exwm-floating.el (exwm-floating--set-floating):
* exwm-manage.el (exwm-manage--manage-window):
* exwm-systemtray.el (exwm-systemtray--init):
* exwm-workspace.el (exwm-workspace--add-frame-as-workspace)
(exwm-workspace--init):
* exwm.el (exwm--init-icccm-ewmh):
Explicitly specify the class (InputOutput or InputOnly) and for an
InputOutput X window the background pixmap when creating an X window.
This commit is contained in:
Chris Feng 2016-08-12 19:18:32 +08:00
parent 8e3fc3602f
commit db5128c1b9
5 changed files with 85 additions and 34 deletions

View file

@ -70,11 +70,14 @@ context of the corresponding buffer.")
(defvar exwm-workspace--current) (defvar exwm-workspace--current)
(defvar exwm-workspace--struts) (defvar exwm-workspace--struts)
(defvar exwm-workspace--workareas)
(defvar exwm-workspace-current-index)
(declare-function exwm-layout--refresh "exwm-layout.el" ()) (declare-function exwm-layout--refresh "exwm-layout.el" ())
(declare-function exwm-layout--show "exwm-layout.el" (id &optional window)) (declare-function exwm-layout--show "exwm-layout.el" (id &optional window))
(declare-function exwm-layout--iconic-state-p "exwm-layout.el" (&optional id)) (declare-function exwm-layout--iconic-state-p "exwm-layout.el" (&optional id))
(declare-function exwm-workspace--minibuffer-own-frame-p "exwm-workspace.el") (declare-function exwm-workspace--minibuffer-own-frame-p "exwm-workspace.el")
(declare-function exwm-workspace--position "exwm-workspace.el" (frame))
(defun exwm-floating--set-floating (id) (defun exwm-floating--set-floating (id)
"Make window ID floating." "Make window ID floating."
@ -191,12 +194,19 @@ context of the corresponding buffer.")
;; a child of the X window container. ;; a child of the X window container.
(xcb:+request exwm--connection (xcb:+request exwm--connection
(make-instance 'xcb:CreateWindow (make-instance 'xcb:CreateWindow
:depth 0 :wid frame-container :depth 0
:wid frame-container
:parent container :parent container
:x 0 :y 0 :width width :height height :border-width 0 :x 0
:class xcb:WindowClass:CopyFromParent :y 0
:visual 0 ;CopyFromParent :width width
:value-mask xcb:CW:OverrideRedirect :height height
:border-width 0
:class xcb:WindowClass:InputOutput
:visual 0
:value-mask (logior xcb:CW:BackPixmap
xcb:CW:OverrideRedirect)
:background-pixmap xcb:BackPixmap:ParentRelative
:override-redirect 1)) :override-redirect 1))
;; Put it at bottom. ;; Put it at bottom.
(xcb:+request exwm--connection (xcb:+request exwm--connection

View file

@ -83,6 +83,7 @@ corresponding buffer.")
(defvar exwm-workspace--current) (defvar exwm-workspace--current)
(defvar exwm-workspace--switch-history-outdated) (defvar exwm-workspace--switch-history-outdated)
(defvar exwm-workspace-current-index) (defvar exwm-workspace-current-index)
(defvar exwm-workspace--workareas)
(declare-function exwm--update-window-type "exwm.el" (id &optional force)) (declare-function exwm--update-window-type "exwm.el" (id &optional force))
(declare-function exwm--update-class "exwm.el" (id &optional force)) (declare-function exwm--update-class "exwm.el" (id &optional force))
@ -208,14 +209,21 @@ corresponding buffer.")
(setq exwm--container (xcb:generate-id exwm--connection)) (setq exwm--container (xcb:generate-id exwm--connection))
(xcb:+request exwm--connection (xcb:+request exwm--connection
(make-instance 'xcb:CreateWindow (make-instance 'xcb:CreateWindow
:depth 0 :wid exwm--container :depth 0
:wid exwm--container
:parent (frame-parameter exwm-workspace--current :parent (frame-parameter exwm-workspace--current
'exwm-workspace) 'exwm-workspace)
:x 0 :y 0 :width 1 :height 1 :border-width 0 :x 0
:class xcb:WindowClass:CopyFromParent :y 0
:visual 0 ;CopyFromParent :width 1
:value-mask (logior xcb:CW:OverrideRedirect :height 1
:border-width 0
:class xcb:WindowClass:InputOutput
:visual 0
:value-mask (logior xcb:CW:BackPixmap
xcb:CW:OverrideRedirect
xcb:CW:EventMask) xcb:CW:EventMask)
:background-pixmap xcb:BackPixmap:ParentRelative
:override-redirect 1 :override-redirect 1
:event-mask xcb:EventMask:SubstructureRedirect)) :event-mask xcb:EventMask:SubstructureRedirect))
(exwm--debug (exwm--debug

View file

@ -334,10 +334,17 @@ You shall use the default value if using auto-hide minibuffer.")
(setq exwm-systemtray--selection-owner-window id) (setq exwm-systemtray--selection-owner-window id)
(xcb:+request exwm-systemtray--connection (xcb:+request exwm-systemtray--connection
(make-instance 'xcb:CreateWindow (make-instance 'xcb:CreateWindow
:depth 0 :wid id :parent exwm--root :depth 0
:x 0 :y 0 :width 1 :height 1 :wid id
:border-width 0 :class xcb:WindowClass:InputOnly :parent exwm--root
:visual 0 :value-mask xcb:CW:OverrideRedirect :x 0
:y 0
:width 1
:height 1
:border-width 0
:class xcb:WindowClass:InputOnly
:visual 0
:value-mask xcb:CW:OverrideRedirect
:override-redirect 1)) :override-redirect 1))
;; Get the selection ownership. ;; Get the selection ownership.
(xcb:+request exwm-systemtray--connection (xcb:+request exwm-systemtray--connection
@ -397,7 +404,7 @@ You shall use the default value if using auto-hide minibuffer.")
:width 1 :width 1
:height exwm-systemtray-height :height exwm-systemtray-height
:border-width 0 :border-width 0
:class xcb:WindowClass:CopyFromParent :class xcb:WindowClass:InputOutput
:visual 0 :visual 0
:value-mask (logior xcb:CW:BackPixmap xcb:CW:EventMask) :value-mask (logior xcb:CW:BackPixmap xcb:CW:EventMask)
:background-pixmap xcb:BackPixmap:ParentRelative :background-pixmap xcb:BackPixmap:ParentRelative

View file

@ -1171,14 +1171,20 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
(set-frame-parameter frame param (frame-parameter w param)))) (set-frame-parameter frame param (frame-parameter w param))))
(xcb:+request exwm--connection (xcb:+request exwm--connection
(make-instance 'xcb:CreateWindow (make-instance 'xcb:CreateWindow
:depth 0 :wid workspace :parent exwm--root :depth 0
:x 0 :y 0 :wid workspace
:parent exwm--root
:x 0
:y 0
:width (x-display-pixel-width) :width (x-display-pixel-width)
:height (x-display-pixel-height) :height (x-display-pixel-height)
:border-width 0 :class xcb:WindowClass:CopyFromParent :border-width 0
:visual 0 ;CopyFromParent :class xcb:WindowClass:InputOutput
:value-mask (logior xcb:CW:OverrideRedirect :visual 0
:value-mask (logior xcb:CW:BackPixmap
xcb:CW:OverrideRedirect
xcb:CW:EventMask) xcb:CW:EventMask)
:background-pixmap xcb:BackPixmap:ParentRelative
:override-redirect 1 :override-redirect 1
:event-mask xcb:EventMask:SubstructureRedirect)) :event-mask xcb:EventMask:SubstructureRedirect))
(xcb:+request exwm--connection (xcb:+request exwm--connection
@ -1188,13 +1194,19 @@ Please check `exwm-workspace--minibuffer-own-frame-p' first."
:stack-mode xcb:StackMode:Below)) :stack-mode xcb:StackMode:Below))
(xcb:+request exwm--connection (xcb:+request exwm--connection
(make-instance 'xcb:CreateWindow (make-instance 'xcb:CreateWindow
:depth 0 :wid container :parent workspace :depth 0
:x 0 :y 0 :wid container
:parent workspace
:x 0
:y 0
:width (x-display-pixel-width) :width (x-display-pixel-width)
:height (x-display-pixel-height) :height (x-display-pixel-height)
:border-width 0 :class xcb:WindowClass:CopyFromParent :border-width 0
:visual 0 ;CopyFromParent :class xcb:WindowClass:InputOutput
:value-mask xcb:CW:OverrideRedirect :visual 0
:value-mask (logior xcb:CW:BackPixmap
xcb:CW:OverrideRedirect)
:background-pixmap xcb:BackPixmap:ParentRelative
:override-redirect 1)) :override-redirect 1))
(exwm--debug (exwm--debug
(xcb:+request exwm--connection (xcb:+request exwm--connection
@ -1372,12 +1384,19 @@ applied to all subsequently created X frames."
container) container)
(xcb:+request exwm--connection (xcb:+request exwm--connection
(make-instance 'xcb:CreateWindow (make-instance 'xcb:CreateWindow
:depth 0 :wid container :parent exwm--root :depth 0
:x -1 :y -1 :width 1 :height 1 :wid container
:parent exwm--root
:x 0
:y 0
:width 1
:height 1
:border-width 0 :border-width 0
:class xcb:WindowClass:CopyFromParent :class xcb:WindowClass:InputOutput
:visual 0 ;CopyFromParent :visual 0
:value-mask xcb:CW:OverrideRedirect :value-mask (logior xcb:CW:BackPixmap
xcb:CW:OverrideRedirect)
:background-pixmap xcb:BackPixmap:ParentRelative
:override-redirect 1)) :override-redirect 1))
(exwm--debug (exwm--debug
(xcb:+request exwm--connection (xcb:+request exwm--connection

15
exwm.el
View file

@ -609,10 +609,17 @@
(let ((new-id (xcb:generate-id exwm--connection))) (let ((new-id (xcb:generate-id exwm--connection)))
(xcb:+request exwm--connection (xcb:+request exwm--connection
(make-instance 'xcb:CreateWindow (make-instance 'xcb:CreateWindow
:depth 0 :wid new-id :parent exwm--root :depth 0
:x -1 :y -1 :width 1 :height 1 :wid new-id
:border-width 0 :class xcb:WindowClass:CopyFromParent :parent exwm--root
:visual 0 :value-mask xcb:CW:OverrideRedirect :x 0
:y 0
:width 1
:height 1
:border-width 0
:class xcb:WindowClass:InputOnly
:visual 0
:value-mask xcb:CW:OverrideRedirect
:override-redirect 1)) :override-redirect 1))
(dolist (i (list exwm--root new-id)) (dolist (i (list exwm--root new-id))
;; Set _NET_SUPPORTING_WM_CHECK ;; Set _NET_SUPPORTING_WM_CHECK