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
=== modified file 'NuxGraphics/GraphicsDisplayX11.cpp'
--- NuxGraphics/GraphicsDisplayX11.cpp 2013-10-07 12:10:41 +0000
+++ NuxGraphics/GraphicsDisplayX11.cpp 2013-10-10 23:52:43 +0000
@@ -1359,6 +1359,12 @@
1359 bool bProcessEvent = true;1359 bool bProcessEvent = true;
1360 XNextEvent(m_X11Display, &xevent);1360 XNextEvent(m_X11Display, &xevent);
13611361
1362 if ((xevent.type == KeyPress || xevent.type == KeyRelease) &&
1363 m_xim_controller->GetCurrentWindow() != xevent.xkey.window)
1364 {
1365 m_xim_controller->SetFocusedWindow(xevent.xkey.window);
1366 }
1367
1362 if (XFilterEvent(&xevent, None) == True)1368 if (XFilterEvent(&xevent, None) == True)
1363 return true;1369 return true;
13641370
13651371
=== modified file 'NuxGraphics/XIMController.cpp'
--- NuxGraphics/XIMController.cpp 2013-09-05 22:24:24 +0000
+++ NuxGraphics/XIMController.cpp 2013-10-10 23:52:43 +0000
@@ -81,6 +81,11 @@
81 xic_client_.DestroyXIC();81 xic_client_.DestroyXIC();
82}82}
8383
84Window XIMController::GetCurrentWindow() const
85{
86 return window_;
87}
88
84void XIMController::InitXIMCallback()89void XIMController::InitXIMCallback()
85{90{
86 char* const xmodifier = getenv("XMODIFIERS");91 char* const xmodifier = getenv("XMODIFIERS");
8792
=== modified file 'NuxGraphics/XIMController.h'
--- NuxGraphics/XIMController.h 2012-12-17 19:04:50 +0000
+++ NuxGraphics/XIMController.h 2013-10-10 23:52:43 +0000
@@ -44,6 +44,9 @@
4444
45 void FocusInXIC();45 void FocusInXIC();
46 void FocusOutXIC();46 void FocusOutXIC();
47
48 Window GetCurrentWindow() const;
49
47private:50private:
48 void InitXIMCallback();51 void InitXIMCallback();
49 static void SetupXIMClientCallback(Display* dpy, XPointer client_data, XPointer call_data);52 static void SetupXIMClientCallback(Display* dpy, XPointer client_data, XPointer call_data);

Subscribers

People subscribed via source and target branches