This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via 5da172bec1439fa9219e02da0f1e68383d56caad (commit) from 92cadf14e3dddf0bc97848999152f3ae2e8d53a5 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/5da172bec1439fa9219e02da0f1e68383d56c...
commit 5da172bec1439fa9219e02da0f1e68383d56caad Author: Cyril Hrubis metan@ucw.cz Date: Sat May 12 21:56:31 2012 +0200
backends: fb: restore KB mode on exit.
diff --git a/libs/backends/GP_LinuxFB.c b/libs/backends/GP_LinuxFB.c index 3a2cf7e..d6de2de 100644 --- a/libs/backends/GP_LinuxFB.c +++ b/libs/backends/GP_LinuxFB.c @@ -41,9 +41,15 @@ struct fb_priv { GP_Context context; uint32_t bsize; + + int flag; + + /* console fd, nr and saved data */ int con_fd; int con_nr; int last_con_nr; + int saved_kb_mode; + int fb_fd; char path[]; }; @@ -91,7 +97,7 @@ static int allocate_console(struct fb_priv *fb, int flag) if (ioctl(fd, VT_GETSTATE, &vts) == 0) fb->last_con_nr = vts.v_active; - else + else fb->last_con_nr = -1;
if (ioctl(fd, VT_ACTIVATE, nr) < 0) { @@ -130,6 +136,16 @@ static int allocate_console(struct fb_priv *fb, int flag) return -1; } + if (ioctl(fd, KDGKBMODE, &fb->saved_kb_mode)) { + GP_DEBUG(1, "Failed to ioctl KDGKBMODE %s: %s", + buf, strerror(errno)); + close(fd); + return -1; + } + + GP_DEBUG(2, "Previous keyboard mode was '%i'", + fb->saved_kb_mode); + if (ioctl(fd, KDSKBMODE, K_MEDIUMRAW) < 0) { GP_DEBUG(1, "Failed to ioctl KDSKBMODE %s: %s", buf, strerror(errno)); @@ -183,6 +199,14 @@ static void fb_exit(GP_Backend *self) /* reset keyboard */ ioctl(fb->con_fd, KDSETMODE, KD_TEXT); + /* restore keyboard mode */ + if (fb->flag) { + if (ioctl(fb->con_fd, KDSKBMODE, fb->saved_kb_mode) < 0) { + GP_DEBUG(1, "Failed to ioctl KDSKBMODE (restore KBMODE)" + " /dev/tty%i: %s", fb->con_nr, strerror(errno)); + } + } + /* switch back console */ if (fb->last_con_nr != -1) ioctl(fb->con_fd, VT_ACTIVATE, fb->last_con_nr); @@ -267,6 +291,7 @@ GP_Backend *GP_BackendLinuxFBInit(const char *path, int flag) fb->fb_fd = fd; fb->bsize = fscri.smem_len; strcpy(fb->path, path); + fb->flag = flag;
fb->context.w = vscri.xres; fb->context.h = vscri.yres;
-----------------------------------------------------------------------
Summary of changes: libs/backends/GP_LinuxFB.c | 27 ++++++++++++++++++++++++++- 1 files changed, 26 insertions(+), 1 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.