Nux

Merge lp:~brandontschaefer/nux/lp.1219330 into lp:nux

Proposed by Brandon Schaefer
Status: Merged
Approved by: Christopher Townsend
Approved revision: 812
Merged at revision: 814
Proposed branch: lp:~brandontschaefer/nux/lp.1219330
Merge into: lp:nux
Diff against target: 36 lines (+5/-10)
2 files modified
NuxGraphics/Events.cpp (+1/-4)
NuxGraphics/GraphicsDisplayX11.cpp (+4/-6)
To merge this branch: bzr merge lp:~brandontschaefer/nux/lp.1219330
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Christopher Townsend Approve
Review via email: mp+184160@code.launchpad.net

Commit message

Always use a dynamic char* when dealing with text events. We were using a static text, then allocating dtext causing ibus to get confused on what to use.

Description of the change

Always use a dynamic char* when dealing with text events. We were using a static text, then allocating dtext causing ibus to get confused on what to use.

To post a comment you must log in.
Revision history for this message
Christopher Townsend (townsend) wrote :

LGTM and I'm sure this will make some people happy:)

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NuxGraphics/Events.cpp'
2--- NuxGraphics/Events.cpp 2013-05-13 19:53:15 +0000
3+++ NuxGraphics/Events.cpp 2013-09-05 18:00:11 +0000
4@@ -213,10 +213,7 @@
5
6 const char* Event::GetText() const
7 {
8- if (dtext)
9- return dtext;
10-
11- return text;
12+ return dtext;
13 }
14
15
16
17=== modified file 'NuxGraphics/GraphicsDisplayX11.cpp'
18--- NuxGraphics/GraphicsDisplayX11.cpp 2013-08-28 01:25:13 +0000
19+++ NuxGraphics/GraphicsDisplayX11.cpp 2013-09-05 18:00:11 +0000
20@@ -1745,13 +1745,11 @@
21 }
22 else
23 {
24- num_char_stored = XLookupString(&xevent.xkey, buffer, NUX_EVENT_TEXT_BUFFER_SIZE,
25- (KeySym*) &m_pEvent->x11_keysym, NULL);
26+ m_pEvent->dtext = new char[NUX_EVENT_TEXT_BUFFER_SIZE];
27+ num_char_stored = XLookupString(&xevent.xkey, m_pEvent->dtext, NUX_EVENT_TEXT_BUFFER_SIZE,
28+ (KeySym*) &m_pEvent->x11_keysym, nullptr);
29
30- if (num_char_stored > 0)
31- {
32- Memcpy(m_pEvent->text, buffer, num_char_stored);
33- }
34+ m_pEvent->dtext[num_char_stored] = 0;
35 }
36 }
37

Subscribers

People subscribed via source and target branches