Nux

Merge lp:~brandontschaefer/nux/xic-sync-xevent-window into lp:nux

Proposed by Brandon Schaefer
Status: Merged
Approved by: Christopher Townsend
Approved revision: 821
Merged at revision: 826
Proposed branch: lp:~brandontschaefer/nux/xic-sync-xevent-window
Merge into: lp:nux
Diff against target: 46 lines (+14/-0)
3 files modified
NuxGraphics/GraphicsDisplayX11.cpp (+6/-0)
NuxGraphics/XIMController.cpp (+5/-0)
NuxGraphics/XIMController.h (+3/-0)
To merge this branch: bzr merge lp:~brandontschaefer/nux/xic-sync-xevent-window
Reviewer Review Type Date Requested Status
Christopher Townsend (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+190509@code.launchpad.net

Commit message

We need to check if the XIC client is synced up with the xevents coming in. If someone changes the focus window and our XIC hasn't been updated, we need to make sure we stay synced. Otherwise XIM fails to work.

Description of the change

We need to check if the XIC client is synced up with the xevents coming in. If someone changes the focus window and our XIC hasn't been updated, we need to make sure we stay synced. Otherwise XIM fails to work.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Christopher Townsend (townsend) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NuxGraphics/GraphicsDisplayX11.cpp'
2--- NuxGraphics/GraphicsDisplayX11.cpp 2013-10-07 12:10:41 +0000
3+++ NuxGraphics/GraphicsDisplayX11.cpp 2013-10-10 23:52:43 +0000
4@@ -1359,6 +1359,12 @@
5 bool bProcessEvent = true;
6 XNextEvent(m_X11Display, &xevent);
7
8+ if ((xevent.type == KeyPress || xevent.type == KeyRelease) &&
9+ m_xim_controller->GetCurrentWindow() != xevent.xkey.window)
10+ {
11+ m_xim_controller->SetFocusedWindow(xevent.xkey.window);
12+ }
13+
14 if (XFilterEvent(&xevent, None) == True)
15 return true;
16
17
18=== modified file 'NuxGraphics/XIMController.cpp'
19--- NuxGraphics/XIMController.cpp 2013-09-05 22:24:24 +0000
20+++ NuxGraphics/XIMController.cpp 2013-10-10 23:52:43 +0000
21@@ -81,6 +81,11 @@
22 xic_client_.DestroyXIC();
23 }
24
25+Window XIMController::GetCurrentWindow() const
26+{
27+ return window_;
28+}
29+
30 void XIMController::InitXIMCallback()
31 {
32 char* const xmodifier = getenv("XMODIFIERS");
33
34=== modified file 'NuxGraphics/XIMController.h'
35--- NuxGraphics/XIMController.h 2012-12-17 19:04:50 +0000
36+++ NuxGraphics/XIMController.h 2013-10-10 23:52:43 +0000
37@@ -44,6 +44,9 @@
38
39 void FocusInXIC();
40 void FocusOutXIC();
41+
42+ Window GetCurrentWindow() const;
43+
44 private:
45 void InitXIMCallback();
46 static void SetupXIMClientCallback(Display* dpy, XPointer client_data, XPointer call_data);

Subscribers

People subscribed via source and target branches