[gnome-remote-desktop] clipboard-rdp: Use g_idle_add() instead of g_timeout_add()



commit 4b31d8412ce2ef1291414caab0d1662496532b73
Author: Pascal Nowack <Pascal Nowack gmx de>
Date:   Wed Apr 28 17:25:31 2021 +0200

    clipboard-rdp: Use g_idle_add() instead of g_timeout_add()
    
    Currently, we pass an interval of 0 to g_timeout_add() instead of using
    g_idle_add().
    The main context of the main thread is however fast enough to pick
    these queued tasks up, so change these calls to g_idle_add().
    
    Furthermore, if we use g_idle_add() for other queued tasks in
    clipboard-rdp later, when implementing clipboard data locking, this
    ensures we won't completely mess up the order of which tasks run first.

 src/grd-clipboard-rdp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/grd-clipboard-rdp.c b/src/grd-clipboard-rdp.c
index 07b0c2c..b00aed9 100644
--- a/src/grd-clipboard-rdp.c
+++ b/src/grd-clipboard-rdp.c
@@ -956,7 +956,7 @@ cliprdr_client_format_list (CliprdrServerContext      *cliprdr_context,
   update_context->mime_type_tables = mime_type_tables;
 
   clipboard_rdp->server_format_list_update_id =
-    g_timeout_add (0, update_server_format_list, update_context);
+    g_idle_add (update_server_format_list, update_context);
   SetEvent (clipboard_rdp->format_list_received_event);
 
   return CHANNEL_RC_OK;
@@ -1008,7 +1008,7 @@ cliprdr_client_format_list_response (CliprdrServerContext               *cliprdr
 
   clipboard_rdp->format_list_response_msg_flags = format_list_response->msgFlags;
   clipboard_rdp->client_format_list_response_id =
-    g_timeout_add (0, handle_format_list_response, clipboard_rdp);
+    g_idle_add (handle_format_list_response, clipboard_rdp);
   SetEvent (format_list_response_received_event);
 
   return CHANNEL_RC_OK;
@@ -1266,7 +1266,7 @@ cliprdr_client_format_data_request (CliprdrServerContext              *cliprdr_c
       request_context->needs_conversion = needs_conversion;
 
       clipboard_rdp->server_format_data_request_id =
-        g_timeout_add (0, request_server_format_data, request_context);
+        g_idle_add (request_server_format_data, request_context);
       SetEvent (clipboard_rdp->format_data_request_received_event);
 
       return CHANNEL_RC_OK;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]