-
Notifications
You must be signed in to change notification settings - Fork 15
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
Refine event handling #67
Conversation
Consider the further cleanups: --- a/include/twin.h
+++ b/include/twin.h
@@ -455,15 +455,10 @@ typedef twin_time_t (*twin_timeout_proc_t)(twin_time_t now, void *closure);
typedef bool (*twin_work_proc_t)(void *closure);
-typedef enum _twin_file_op { TWIN_READ = 1, TWIN_WRITE = 2 } twin_file_op_t;
-
-typedef bool (*twin_file_proc_t)(int file, twin_file_op_t ops, void *closure);
-
#define twin_time_compare(a, op, b) (((a) - (b)) op 0)
typedef struct _twin_timeout twin_timeout_t;
typedef struct _twin_work twin_work_t;
-typedef struct _twin_file twin_file_t;
/*
* Widgets
@@ -656,17 +651,6 @@ void twin_premultiply_alpha(twin_pixmap_t *px);
void twin_event_enqueue(const twin_event_t *event);
-/*
- * file.c
- */
-
-twin_file_t *twin_set_file(twin_file_proc_t file_proc,
- int file,
- twin_file_op_t ops,
- void *closure);
-
-void twin_clear_file(twin_file_t *file);
-
/*
* fixed.c
*/
--- a/include/twin_private.h
+++ b/include/twin_private.h
@@ -472,14 +472,6 @@ struct _twin_work {
void *closure;
};
-struct _twin_file {
- twin_queue_t queue;
- int file;
- twin_file_op_t ops;
- twin_file_proc_t proc;
- void *closure;
-};
-
typedef enum _twin_order {
TWIN_BEFORE = -1,
TWIN_AT = 0,
@@ -504,8 +496,6 @@ twin_queue_t *_twin_queue_set_order(twin_queue_t **head);
void _twin_queue_review_order(twin_queue_t *first);
-int _twin_run_file(twin_time_t delay);
-
void _twin_run_timeout(void);
twin_time_t _twin_timeout_delay(void); |
5dc19f7
to
7969441
Compare
I noticed you removed the |
@shengwen-tw The entire application is driven by void twin_dispatch(void)
{
for (;;) {
_twin_run_timeout();
_twin_run_work();
if (!_twin_run_file(_twin_timeout_delay()))
break;
}
} |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the backend interface has been changed, the recently-introduced VNC backend implementation should be modified for its poll
operation accordingly.
Why did you close this pull request? |
The previous commit was temporarily removed during the rebase process, which caused Git to close this PR automatically. I will push the new commit once the rebase is fully completed. |
This commit adds a member function for event handling to the backend interface, replacing the previous file-based system that relies on poll(2). The new design addresses issues created by backends like SDL, which do not expose underlying file descriptors. Close sysprog21#4
@ndsl7109256, Can you confirm the proposed changes with VNC backend? |
I also encountered the issues described in #62 and #65 while debugging the fbdev backend, which resulted in the framebuffer being entirely filled with white. Resolving these problems is critical to continue development on platforms with newer generations of Intel CPUs. $ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 39 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 12
On-line CPU(s) list: 0-11
Vendor ID: GenuineIntel
Model name: 13th Gen Intel(R) Core(TM) i7-1355U
CPU family: 6
Model: 186
Thread(s) per core: 2
Core(s) per socket: 10
Socket(s): 1
Stepping: 3
CPU(s) scaling MHz: 28%
CPU max MHz: 5000.0000
CPU min MHz: 400.0000
BogoMIPS: 5222.40 |
@jserv The VNC backend uses the |
Thank @alanjian85 for contributing! |
After merging #65 and #70, the Linux framebuffer backend should be more usable. @alanjian85, please review the recent codebase. |
This commit adds a member function for event handling to the backend interface, replacing the previous file-based system that relies on poll(2). The new design addresses issues created by backends like SDL, which do not expose underlying file descriptors. Integrating the fbdev backend into the updated interface remains to be completed.