summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEleni Maria Stea <elene.mst@gmail.com>2013-02-24 23:04:04 +0200
committerEleni Maria Stea <elene.mst@gmail.com>2013-02-24 23:04:04 +0200
commitecb25bb23fcd6f98fb049297483e312c84fd7b5b (patch)
treeae2cf1aafb83c654295e59f6c7209497e5c304ba
parentc4ab1fa2768863098306862047bdb1116bd62a24 (diff)
fixed win motion bug
-rw-r--r--Makefile2
-rw-r--r--src/fbdev/gfx.cc13
-rw-r--r--src/window.cc5
-rw-r--r--src/wm.cc3
4 files changed, 10 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index ad3fd6c..a894e52 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,7 @@ dbg = -g
opt = -O0
inc = -Isrc
-#backend = SDL
+backend = SDL
ifeq ($(backend), SDL)
def = -DWINNIE_SDL
diff --git a/src/fbdev/gfx.cc b/src/fbdev/gfx.cc
index db579ff..e4527b0 100644
--- a/src/fbdev/gfx.cc
+++ b/src/fbdev/gfx.cc
@@ -55,6 +55,9 @@ bool init_gfx()
return false;
}
+// TODO: uncomment when I find how to use intelfb instead of i915 GRRRR.-
+
+/*
fb_vblank vblank;
if(ioctl(dev_fd, FBIOGET_VBLANK, &vblank) == -1) {
fprintf(stderr, "FBIOGET_VBLANK error: %s\n", strerror(errno));
@@ -64,6 +67,7 @@ bool init_gfx()
printf("count: %d\n", vblank.count);
printf("beam position: %d, %d\n", vblank.hcount, vblank.vcount);
}
+*/
return true;
}
@@ -247,16 +251,9 @@ void gfx_update()
void wait_vsync()
{
unsigned long arg = 0;
-
- timeval tvstart, tvend;
- gettimeofday(&tvstart, 0);
-
if(ioctl(dev_fd, FBIO_WAITFORVSYNC, &arg) == -1) {
- printf("ioctl error %s\n", strerror(errno));
+// printf("ioctl error %s\n", strerror(errno));
}
-
- gettimeofday(&tvend, 0);
- printf("%ld %ld\n", tvend.tv_sec - tvstart.tv_sec, tvend.tv_usec - tvstart.tv_usec);
}
#endif // WINNIE_FBDEV
diff --git a/src/window.cc b/src/window.cc
index a0388fe..21ff70f 100644
--- a/src/window.cc
+++ b/src/window.cc
@@ -92,14 +92,15 @@ void Window::invalidate()
void Window::draw(const Rect &dirty_region)
{
- Rect intersect = rect_intersection(rect, dirty_region);
+ Rect abs_rect = get_absolute_rect();
+ Rect intersect = rect_intersection(abs_rect, dirty_region);
if(intersect.width && intersect.height) {
if(callbacks.display) {
callbacks.display(this);
}
dirty = false;
- draw_children(rect);
+ draw_children(abs_rect);
}
}
diff --git a/src/wm.cc b/src/wm.cc
index 4547e1d..a77f026 100644
--- a/src/wm.cc
+++ b/src/wm.cc
@@ -23,9 +23,8 @@ void WindowManager::create_frame(Window *win)
frame->set_display_callback(display);
frame->set_mouse_button_callback(mouse);
frame->set_mouse_motion_callback(motion);
-
- frame->add_child(win);
frame->set_focusable(false);
+ frame->add_child(win);
windows.push_back(frame);