Sections
Personal tools
You are here: Home people nm Archive 2008 July 09 xvnkb cvs patch
« December 2008 »
Su Mo Tu We Th Fr Sa
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Archives
Topics
Topics in Detail…
Tag cloud
Programming
 
Document Actions

xvnkb cvs patch

by nm last modified 2008-07-09 14:24
Filed Under:

Patch for these problem: power consumption and crash w/ xscreensaver.

Ngồi mân mê cái laptop thấy cpu bị switch khỏi idle mode rất nhiều. Ngó nghiêng một lúc thấy nguyên nhân là tại xvnkb nhà ta.  usleep(10000) được gọi liên tục trong main.c.

bản patch bonus thêm cái vụ crash với xscreensaver khi gõ password.

diff -r ./xvnkb_patch/main.c ./xvnkb_org/main.c
92d91
<       XEvent peekEvt;
94,95c93,94
<               //usleep(1000);
<               XPeekEvent(display, &peekEvt);
---
>               usleep(1000);
>
105c104
<               do {
---
>               while( XPending(display) ) {
110c109
<               } while( XPending(display) );
---
>               }


diff -r ./xvnkb_patch/xvnkb.c ./xvnkb_org/xvnkb.c
276,285c276
<
<               /*
<                * CHANGES:
<                * - SEG FAULT report & fixed by nm <nm@vnoss.org>
<                * problem occur when main app call XLookupString w/ keysym arg = NULL.
<                * (xscreensaver/lock.c :: size = XLookupString(event, s, 1, 0, compose_status) )
<                * pointer keysym must be validate before used.
<                */
<               if (keysym)
<                 *keysym = vk_charset==VKC_UTF8 ? *pw|0x01000000 : (*(char *)buffer & 0xFF);
---
>               *keysym = vk_charset==VKC_UTF8 ? *pw|0x01000000 : (*(char *)buffer & 0xFF);




Blog Author
nm
Location: n/a
nm
 
Recent Comments
No comments posted yet.
Syndication
Atom
RDF
RSS 2.0
 

Powered by Plone CMS, the Open Source Content Management System