Commit c8ccb166 authored by dscho's avatar dscho

cleanups; libvncclient supports -encodings already

parent 2e9817e0
...@@ -27,7 +27,7 @@ static rfbBool resize(rfbClient* client) { ...@@ -27,7 +27,7 @@ static rfbBool resize(rfbClient* client) {
} }
} else { } else {
SDL_Surface* sdl=client->clientData; SDL_Surface* sdl=client->clientData;
fprintf(stderr,"Could not set resolution %dx%d!\n", rfbClientLog("Could not set resolution %dx%d!\n",
client->width,client->height); client->width,client->height);
if(sdl) { if(sdl) {
client->width=sdl->w; client->width=sdl->w;
...@@ -167,15 +167,18 @@ rfbKeySym SDL_keysym2rfbKeySym(int keysym) { ...@@ -167,15 +167,18 @@ rfbKeySym SDL_keysym2rfbKeySym(int keysym) {
case SDLK_LALT: return XK_Alt_L; case SDLK_LALT: return XK_Alt_L;
case SDLK_RMETA: return XK_Meta_R; case SDLK_RMETA: return XK_Meta_R;
case SDLK_LMETA: return XK_Meta_L; case SDLK_LMETA: return XK_Meta_L;
//case SDLK_LSUPER: return XK_LSuper; /* left "windows" key */ #if 0
//case SDLK_RSUPER: return XK_RSuper; /* right "windows" key */ /* TODO: find out keysyms */
case SDLK_LSUPER: return XK_LSuper; /* left "windows" key */
case SDLK_RSUPER: return XK_RSuper; /* right "windows" key */
case SDLK_COMPOSE: return XK_Compose;
#endif
case SDLK_MODE: return XK_Mode_switch; case SDLK_MODE: return XK_Mode_switch;
//case SDLK_COMPOSE: return XK_Compose;
case SDLK_HELP: return XK_Help; case SDLK_HELP: return XK_Help;
case SDLK_PRINT: return XK_Print; case SDLK_PRINT: return XK_Print;
case SDLK_SYSREQ: return XK_Sys_Req; case SDLK_SYSREQ: return XK_Sys_Req;
case SDLK_BREAK: return XK_Break; case SDLK_BREAK: return XK_Break;
default: fprintf(stderr,"Unknown keysym: %d\n",keysym); default: rfbClientLog("Unknown keysym: %d\n",keysym);
} }
} }
...@@ -195,15 +198,6 @@ int main(int argc,char** argv) { ...@@ -195,15 +198,6 @@ int main(int argc,char** argv) {
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE); SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE);
cl=rfbGetClient(5,3,2); cl=rfbGetClient(5,3,2);
i=1;
while(i<argc-1) {
if(i+1<argc-1 && !strcmp(argv[i],"-encodings")) {
cl->appData.encodingsString=argv[i+1];
i+=2;
}
}
argc-=i-1;
memmove(argv+1,argv+i,(argc-1)*sizeof(char*));
cl->MallocFrameBuffer=resize; cl->MallocFrameBuffer=resize;
cl->GotFrameBufferUpdate=update; cl->GotFrameBufferUpdate=update;
if(!rfbInitClient(cl,&argc,argv)) if(!rfbInitClient(cl,&argc,argv))
...@@ -238,6 +232,10 @@ int main(int argc,char** argv) { ...@@ -238,6 +232,10 @@ int main(int argc,char** argv) {
case SDL_QUIT: case SDL_QUIT:
rfbClientCleanup(cl); rfbClientCleanup(cl);
return 0; return 0;
case SDL_ACTIVEEVENT:
break;
default:
rfbClientLog("ignore SDL event: 0x%x\n",e.type);
} }
else { else {
i=WaitForMessage(cl,500); i=WaitForMessage(cl,500);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment