[hackers] [swk] do not initialize twice the video (fix n900 100% cpu) || pancake

From: <hg_AT_suckless.org>
Date: Wed, 28 Apr 2010 21:12:18 +0000 (UTC)

changeset: 30:f140304792f8
tag: tip
user: pancake <pancake_AT_nopcode.org>
date: Wed Apr 28 23:05:51 2010 +0200
files: gi_sdl.c
description:
do not initialize twice the video (fix n900 100% cpu)
fix mousebuttondown scrolling
scroll two times

diff -r 102e189e199b -r f140304792f8 gi_sdl.c
--- a/gi_sdl.c Wed Apr 28 22:32:03 2010 +0200
+++ b/gi_sdl.c Wed Apr 28 23:05:51 2010 +0200
@@ -70,7 +70,6 @@
                 fprintf(stderr, "Cannot initialize TTF: %s\n", TTF_GetError());
                 return 0;
         }
- SDL_VideoInit(NULL, 0);
         SDL_SetVideoMode(w->r.w, w->r.h, BPP, SDLFLAGS);
         // double init is necesary to get window size
         SDL_SetVideoMode(w->r.w, w->r.h, BPP, SDLFLAGS);
@@ -132,10 +131,12 @@
                         if(event.motion.y>mousedowny+fs) {
                                 mousedowny = event.motion.y;
                                 swk_scroll_up(w);
+ swk_scroll_up(w);
                         } else
                         if(event.motion.y<mousedowny-fs) {
                                 mousedowny = event.motion.y;
                                 swk_scroll_down(w);
+ swk_scroll_down(w);
                         }
                 } else {
                         ret->type = EMotion;
@@ -148,7 +149,7 @@
                 break;
         case SDL_MOUSEBUTTONDOWN:
                 mousedown = 1;
- mousedowny = event.motion.y;
+ mousedowny = event.button.y;
                 fprintf(stderr, "event: click %d\n", event.button.button);
                 ret->type = EClick;
                 ret->data.click.button = event.button.button;
Received on Wed Apr 28 2010 - 21:12:18 UTC

This archive was generated by hypermail 2.2.0 : Wed Apr 28 2010 - 21:24:03 UTC