[client] clipboard/wayland: make use of boilerplate from wm.c

This commit is contained in:
Tudor Brindus
2021-01-11 20:55:42 -05:00
committed by Geoffrey McRae
parent 2aa2ec31ef
commit 96c10c2c2d
4 changed files with 133 additions and 169 deletions

View File

@@ -2031,21 +2031,6 @@ static int lg_run()
return -1;
}
for (LG_Clipboard ** clipboard = LG_Clipboards; *clipboard; clipboard++)
if ((*clipboard)->init(&g_state.wminfo, clipboardRelease, clipboardNotify, clipboardData))
{
g_state.lgc = *clipboard;
break;
}
if (g_state.lgc)
{
DEBUG_INFO("Using Clipboard: %s", g_state.lgc->getName());
g_state.cbRequestList = ll_new();
}
else
DEBUG_WARN("Failed to initialize the clipboard interface, continuing anyway");
initSDLCursor();
if (params.hideMouse)
SDL_ShowCursor(SDL_DISABLE);
@@ -2081,6 +2066,21 @@ static int lg_run()
wmInit();
for (LG_Clipboard ** clipboard = LG_Clipboards; *clipboard; clipboard++)
if ((*clipboard)->init(&g_state.wminfo, clipboardRelease, clipboardNotify, clipboardData))
{
g_state.lgc = *clipboard;
break;
}
if (g_state.lgc)
{
DEBUG_INFO("Using Clipboard: %s", g_state.lgc->getName());
g_state.cbRequestList = ll_new();
}
else
DEBUG_WARN("Failed to initialize the clipboard interface, continuing anyway");
LGMP_STATUS status;
while(g_state.state == APP_STATE_RUNNING)