X-Git-Url: http://git.mutantstargoat.com?p=winnie;a=blobdiff_plain;f=src%2Fmouse.cc;h=b3f329b2dee4acfce96289edf9dd738d5afd2042;hp=f29841c628e24be29ecba620ffcdd0df092f580b;hb=a43297a61d69ca5fa5bb7ae8407757da978b4dd4;hpb=b73087b9c4e30e034bb1690c492f4c9798e0d09b diff --git a/src/mouse.cc b/src/mouse.cc index f29841c..b3f329b 100644 --- a/src/mouse.cc +++ b/src/mouse.cc @@ -27,7 +27,7 @@ static int bnstate; bool init_mouse() { - if((dev_fd = open("/dev/psaux", O_RDONLY)) == -1) { + if((dev_fd = open("/dev/psaux", O_RDONLY | O_NONBLOCK)) == -1) { fprintf(stderr, "Cannot open /dev/psaux : %s\n", strerror(errno)); return false; } @@ -92,7 +92,7 @@ void process_mouse_event() motion_callback(top, pointer_x - rect.x, pointer_y - rect.y); } } - + MouseButtonFuncType button_callback = top->get_mouse_button_callback(); if(button_callback && (bnstate != prev_state)) { int num_bits = sizeof bnstate * CHAR_BIT; @@ -104,13 +104,6 @@ void process_mouse_event() } } } - - unsigned char *fb = get_framebuffer(); - Rect scr = get_screen_size(); - fb += (scr.width * pointer_y + pointer_x) * 4; - fb[0] = 0; - fb[1] = 0; - fb[2] = 0; } void get_pointer_pos(int *x, int *y)