[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/exwm 7120291 38/64: Merge branch 'pipcet-robustness'
From: |
Chris Feng |
Subject: |
[elpa] externals/exwm 7120291 38/64: Merge branch 'pipcet-robustness' |
Date: |
Thu, 17 Sep 2015 23:18:04 +0000 |
branch: externals/exwm
commit 7120291197fb5ceb032671ba02345d181c77399d
Merge: d998b42 d1806e9
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>
Merge branch 'pipcet-robustness'
---
exwm-input.el | 75 ++++++++++++++++++++++++++++---------------------------
exwm-layout.el | 6 +++-
exwm-manage.el | 7 ++---
3 files changed, 45 insertions(+), 43 deletions(-)
diff --git a/exwm-input.el b/exwm-input.el
index 6b41fff..760e5c9 100644
--- a/exwm-input.el
+++ b/exwm-input.el
@@ -56,26 +56,27 @@ It's updated in several occasions, and only used by
`exwm-input--set-focus'.")
(defun exwm-input--set-focus (id)
"Set input focus to window ID in a proper way."
- (with-current-buffer (exwm--id->buffer id)
- (if (and (not exwm--hints-input)
- (memq xcb:Atom:WM_TAKE_FOCUS exwm--protocols))
- (progn
- (exwm--log "Focus on #x%x with WM_TAKE_FOCUS" id)
- (xcb:+request exwm--connection
- (make-instance 'xcb:icccm:SendEvent
- :destination id
- :event (xcb:marshal
- (make-instance 'xcb:icccm:WM_TAKE_FOCUS
- :window id
- :time
- exwm-input--timestamp)
- exwm--connection))))
- (exwm--log "Focus on #x%x with SetInputFocus" id)
- (xcb:+request exwm--connection
- (make-instance 'xcb:SetInputFocus
- :revert-to xcb:InputFocus:Parent :focus id
- :time xcb:Time:CurrentTime)))
- (xcb:flush exwm--connection)))
+ (when (exwm--id->buffer id)
+ (with-current-buffer (exwm--id->buffer id)
+ (if (and (not exwm--hints-input)
+ (memq xcb:Atom:WM_TAKE_FOCUS exwm--protocols))
+ (progn
+ (exwm--log "Focus on #x%x with WM_TAKE_FOCUS" id)
+ (xcb:+request exwm--connection
+ (make-instance 'xcb:icccm:SendEvent
+ :destination id
+ :event (xcb:marshal
+ (make-instance 'xcb:icccm:WM_TAKE_FOCUS
+ :window id
+ :time
+ exwm-input--timestamp)
+ exwm--connection))))
+ (exwm--log "Focus on #x%x with SetInputFocus" id)
+ (xcb:+request exwm--connection
+ (make-instance 'xcb:SetInputFocus
+ :revert-to xcb:InputFocus:Parent :focus id
+ :time xcb:Time:CurrentTime)))
+ (xcb:flush exwm--connection))))
(defvar exwm-input--focus-window nil "The (Emacs) window to be focused.")
(defvar exwm-input--redirected nil
@@ -311,27 +312,27 @@ It's updated in several occasions, and only used by
`exwm-input--set-focus'.")
(defun exwm-input--grab-keyboard (&optional id)
"Grab all key events on window ID."
(unless id (setq id (exwm--buffer->id (window-buffer))))
- (cl-assert id)
- (when (xcb:+request-checked+request-check exwm--connection
- (make-instance 'xcb:GrabKey
- :owner-events 0 :grab-window id
- :modifiers xcb:ModMask:Any
- :key xcb:Grab:Any
- :pointer-mode xcb:GrabMode:Async
- :keyboard-mode xcb:GrabMode:Async))
- (exwm--log "Failed to grab keyboard for #x%x" id))
- (setq exwm--on-KeyPress 'exwm-input--on-KeyPress-line-mode))
+ (when id
+ (when (xcb:+request-checked+request-check exwm--connection
+ (make-instance 'xcb:GrabKey
+ :owner-events 0 :grab-window id
+ :modifiers xcb:ModMask:Any
+ :key xcb:Grab:Any
+ :pointer-mode xcb:GrabMode:Async
+ :keyboard-mode xcb:GrabMode:Async))
+ (exwm--log "Failed to grab keyboard for #x%x" id))
+ (setq exwm--on-KeyPress 'exwm-input--on-KeyPress-line-mode)))
(defun exwm-input--release-keyboard (&optional id)
"Ungrab all key events on window ID."
(unless id (setq id (exwm--buffer->id (window-buffer))))
- (cl-assert id)
- (when (xcb:+request-checked+request-check exwm--connection
- (make-instance 'xcb:UngrabKey
- :key xcb:Grab:Any :grab-window id
- :modifiers xcb:ModMask:Any))
- (exwm--log "Failed to release keyboard for #x%x" id))
- (setq exwm--on-KeyPress 'exwm-input--on-KeyPress-char-mode))
+ (when id
+ (when (xcb:+request-checked+request-check exwm--connection
+ (make-instance 'xcb:UngrabKey
+ :key xcb:Grab:Any :grab-window id
+ :modifiers xcb:ModMask:Any))
+ (exwm--log "Failed to release keyboard for #x%x" id))
+ (setq exwm--on-KeyPress 'exwm-input--on-KeyPress-char-mode)))
(defun exwm-input-grab-keyboard (&optional id)
"Switch to line-mode."
diff --git a/exwm-layout.el b/exwm-layout.el
index a6b450f..1ffb3b9 100644
--- a/exwm-layout.el
+++ b/exwm-layout.el
@@ -93,6 +93,8 @@
"Make window ID fullscreen."
(interactive)
(with-current-buffer (if id (exwm--id->buffer id) (window-buffer))
+ (when exwm--fullscreen
+ (user-error "Already in full-screen mode."))
;; Set the floating frame fullscreen first when the client is floating
(when exwm--floating-frame
(let* ((outer-id (frame-parameter exwm--floating-frame 'exwm-outer-id))
@@ -130,7 +132,6 @@
:window exwm--id
:data (vector xcb:Atom:_NET_WM_STATE_FULLSCREEN)))
(xcb:flush exwm--connection)
- (cl-assert (not exwm--fullscreen))
(setq exwm--fullscreen t)
(exwm-input-release-keyboard)))
@@ -138,6 +139,8 @@
"Restore window from fullscreen state."
(interactive)
(with-current-buffer (if id (exwm--id->buffer id) (window-buffer))
+ (unless exwm--fullscreen
+ (user-error "Not in full-screen mode."))
;; Restore the floating frame if the client is floating
(when exwm--floating-frame
(xcb:+request exwm--connection
@@ -156,7 +159,6 @@
(xcb:+request exwm--connection
(make-instance 'xcb:ewmh:set-_NET_WM_STATE :window exwm--id :data []))
(xcb:flush exwm--connection)
- (cl-assert exwm--fullscreen)
(setq exwm--fullscreen nil)
(exwm-input-grab-keyboard)))
diff --git a/exwm-manage.el b/exwm-manage.el
index ffe21e2..3274d65 100644
--- a/exwm-manage.el
+++ b/exwm-manage.el
@@ -260,10 +260,9 @@ corresponding buffer.")
"Kill an X client."
(interactive)
(unless id (setq id (exwm--buffer->id (current-buffer))))
- (let ((pid (slot-value
- (xcb:+request-unchecked+reply exwm--connection
- (make-instance 'xcb:ewmh:get-_NET_WM_PID :window id))
- 'value)))
+ (let* ((response (xcb:+request-unchecked+reply exwm--connection
+ (make-instance 'xcb:ewmh:get-_NET_WM_PID :window id)))
+ (pid (and response (slot-value response 'value))))
(if pid
(signal-process pid 'SIGKILL)
(xcb:+request exwm--connection
- [elpa] externals/exwm 35560a4 30/64: Minor fixes for emacsclient, (continued)
- [elpa] externals/exwm 35560a4 30/64: Minor fixes for emacsclient, Chris Feng, 2015/09/17
- [elpa] externals/exwm b755296 26/64: Remove redundant code caused by the concurrency of events (contd, 2), Chris Feng, 2015/09/17
- [elpa] externals/exwm 7bfd429 33/64: Honor `value-mask` field in ConfigureRequest event, Chris Feng, 2015/09/17
- [elpa] externals/exwm dba43b0 32/64: Fix input focus stealing, Chris Feng, 2015/09/17
- [elpa] externals/exwm d998b42 34/64: Provide hooks run when the floating state of a window changes (close #28), Chris Feng, 2015/09/17
- [elpa] externals/exwm 15ad591 35/64: Fix bug when moving a window to the current workspace, Chris Feng, 2015/09/17
- [elpa] externals/exwm 43b00d2 36/64: fix buffer renaming, Chris Feng, 2015/09/17
- [elpa] externals/exwm 2d07429 39/64: Merge branch 'move-window-fix' of https://github.com/pipcet/exwm into pipcet-move-window-fix, Chris Feng, 2015/09/17
- [elpa] externals/exwm 5882015 40/64: Merge branch 'pipcet-move-window-fix', Chris Feng, 2015/09/17
- [elpa] externals/exwm 04e4269 29/64: Improve input focus switch mechanism, Chris Feng, 2015/09/17
- [elpa] externals/exwm 7120291 38/64: Merge branch 'pipcet-robustness',
Chris Feng <=
- [elpa] externals/exwm 5210e13 41/64: Only manage windows mapped as the direct children of root window (close #38), Chris Feng, 2015/09/17
- [elpa] externals/exwm 07e59e0 31/64: Fix multi-screen bugs, Chris Feng, 2015/09/17
- [elpa] externals/exwm d1806e9 37/64: Improve code robustness., Chris Feng, 2015/09/17
- [elpa] externals/exwm bb4ebde 46/64: Fix `exwm-workspace-rename-buffer`, Chris Feng, 2015/09/17
- [elpa] externals/exwm 94bdbfc 42/64: Avoid using the "no window manager" code in Emacs, Chris Feng, 2015/09/17
- [elpa] externals/exwm 874c383 43/64: Merge pull request #42 from pipcet/ewmh-fullscreen, Chris Feng, 2015/09/17
- [elpa] externals/exwm 5f9f673 47/64: Fix window size calculations, Chris Feng, 2015/09/17
- [elpa] externals/exwm 7032ee7 48/64: Re-enable complete refresh of keyboard mapping, Chris Feng, 2015/09/17
- [elpa] externals/exwm 981293f 44/64: Replay KeyPress events instead of fake them in line-mode, Chris Feng, 2015/09/17
- [elpa] externals/exwm f7bec7a 51/64: Minor fix, Chris Feng, 2015/09/17