Skip to content

Fix Inaccurate Window Movement in Linux Framebuffer Backend #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion backend/fbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ static bool twin_fbdev_update_damage(void *closure)
twin_fbdev_t *tx = PRIV(closure);
twin_screen_t *screen = SCREEN(closure);

if (!tx->vt_active && twin_screen_damaged(screen))
if (!tx->vt_active && (tx->fb_base == MAP_FAILED) &&
Copy link
Contributor

@jserv jserv Jun 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the condition tx->fb_base == MAP_FAILED be considered as an early return?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I experimented based on the following code and found that the issue still persists.

--- a/backend/fbdev.c
+++ b/backend/fbdev.c
@@ -190,6 +190,9 @@ static bool twin_fbdev_update_damage(void *closure)
     twin_fbdev_t *tx = PRIV(closure);
     twin_screen_t *screen = SCREEN(closure);
 
+    if (tx->fb_base == MAP_FAILED)
+       return;
+
     if (!tx->vt_active && twin_screen_damaged(screen))
         twin_screen_update(screen);

twin_screen_damaged(screen))
twin_screen_update(screen);

return true;
Expand Down