Skip to content
Snippets Groups Projects
Commit 5c0c16ca authored by Hiroyuki Tanaka's avatar Hiroyuki Tanaka
Browse files

Revert "[REM-3121] Handle GotFrameBufferUpdate on its own thread to prevent freeze"

This reverts commit 70baf16f.
parent df5de585
No related branches found
No related tags found
Loading
......@@ -682,15 +682,8 @@ static void remmina_plugin_vnc_rfb_fill_buffer(rfbClient *cl, guchar *dest, gint
}
}
void remmina_plugin_vnc_rfb_updatefb(gpointer* data){
FrameInfo *frame = (FrameInfo*)data;
rfbClient *cl = frame->cl;
int x = frame->x;
int y = frame->y;
int w = frame->w;
int h = frame->h;
static void remmina_plugin_vnc_rfb_updatefb(rfbClient *cl, int x, int y, int w, int h)
{
TRACE_CALL(__func__);
RemminaProtocolWidget *gp = rfbClientGetClientData(cl, NULL);
RemminaPluginVncData *gpdata = GET_PLUGIN_DATA(gp);
......@@ -698,7 +691,6 @@ void remmina_plugin_vnc_rfb_updatefb(gpointer* data){
gint rowstride;
gint width;
if (gpdata->running){
LOCK_BUFFER(TRUE);
if (w >= 1 || h >= 1) {
......@@ -719,22 +711,6 @@ void remmina_plugin_vnc_rfb_updatefb(gpointer* data){
remmina_plugin_vnc_queue_draw_area(gp, x, y, w, h);
}
free(frame);
return FALSE;
}
static void remmina_plugin_vnc_rfb_got_update(rfbClient *cl, int x, int y, int w, int h)
{
TRACE_CALL(__func__);
FrameInfo* frame = malloc(sizeof(FrameInfo));
frame->cl = cl;
frame->x = x;
frame->y = y;
frame->h = h;
frame->w = w;
g_idle_add(G_SOURCE_FUNC(remmina_plugin_vnc_rfb_updatefb), frame);
}
static void remmina_plugin_vnc_rfb_finished(rfbClient *cl) __attribute__ ((unused));
static void remmina_plugin_vnc_rfb_finished(rfbClient *cl)
......@@ -1163,7 +1139,7 @@ static gboolean remmina_plugin_vnc_main_loop(RemminaProtocolWidget *gp)
if (cl->buffered)
goto handle_buffered;
timeout.tv_sec = 5;
timeout.tv_sec = 10;
timeout.tv_usec = 0;
FD_ZERO(&fds);
FD_SET(cl->sock, &fds);
......@@ -1172,12 +1148,11 @@ static gboolean remmina_plugin_vnc_main_loop(RemminaProtocolWidget *gp)
/* Sometimes it returns <0 when opening a modal dialog in other window. Absolutely weird */
/* So we continue looping anyway */
if (ret <= 0){
if (ret <= 0)
return TRUE;
}
if (FD_ISSET(gpdata->vnc_event_pipe[0], &fds)){
if (FD_ISSET(gpdata->vnc_event_pipe[0], &fds))
remmina_plugin_vnc_process_vnc_event(gp);
}
if (FD_ISSET(cl->sock, &fds)) {
i = WaitForMessage(cl, 500);
if (i < 0)
......@@ -1190,6 +1165,7 @@ handle_buffered:
return FALSE;
}
}
return TRUE;
}
......@@ -1243,8 +1219,7 @@ static gboolean remmina_plugin_vnc_main(RemminaProtocolWidget *gp)
cl->canHandleNewFBSize = TRUE;
cl->GetPassword = remmina_plugin_vnc_rfb_password;
cl->GetCredential = remmina_plugin_vnc_rfb_credential;
cl->GotFrameBufferUpdate = remmina_plugin_vnc_rfb_got_update;
// cl->readTimeout = 60;
cl->GotFrameBufferUpdate = remmina_plugin_vnc_rfb_updatefb;
/**
* @fixme we have to implement FinishedFrameBufferUpdate
* This is to know when the server has finished to send a batch of frame buffer
......@@ -1255,7 +1230,6 @@ static gboolean remmina_plugin_vnc_main(RemminaProtocolWidget *gp)
* @fixme we have to implement HandleKeyboardLedState
* cl->HandleKeyboardLedState = remmina_plugin_vnc_rfb_led_state
*/
cl->FinishedFrameBufferUpdate = remmina_plugin_vnc_rfb_finished;
cl->HandleKeyboardLedState = remmina_plugin_vnc_rfb_led_state;
cl->GotXCutText = (
remmina_plugin_service->file_get_int(remminafile, "disableclipboard", FALSE) ?
......
......@@ -34,8 +34,6 @@
#pragma once
#include "common/remmina_plugin.h"
#include <rfb/rfbclient.h>
#ifndef __PLUGIN_CONFIG_H
#define __PLUGIN_CONFIG_H
......@@ -121,14 +119,6 @@ typedef struct _RemminaPluginVncData {
} RemminaPluginVncData;
typedef struct _FrameInfo{
rfbClient *cl;
int x;
int y;
int w;
int h;
} FrameInfo;
enum {
REMMINA_PLUGIN_VNC_EVENT_KEY,
REMMINA_PLUGIN_VNC_EVENT_POINTER,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment