diff options
Diffstat (limited to 'src/app.c')
-rw-r--r-- | src/app.c | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -762,7 +762,7 @@ static void init_App_(iApp *d, int argc, char **argv) { | |||
762 | mulfv_I2(&d->initialWindowRect.size, desktopDPI_Win32()); | 762 | mulfv_I2(&d->initialWindowRect.size, desktopDPI_Win32()); |
763 | #endif | 763 | #endif |
764 | #if defined (iPlatformLinux) | 764 | #if defined (iPlatformLinux) |
765 | /* Scale by the primary (?) monitor DPI. */ | 765 | /* Scale by the primary (?) monitor DPI. */ |
766 | if (isRunningUnderWindowSystem_App()) { | 766 | if (isRunningUnderWindowSystem_App()) { |
767 | float vdpi; | 767 | float vdpi; |
768 | SDL_GetDisplayDPI(0, NULL, NULL, &vdpi); | 768 | SDL_GetDisplayDPI(0, NULL, NULL, &vdpi); |
@@ -1061,7 +1061,7 @@ void trimMemory_App(void) { | |||
1061 | init_ObjectListIterator(&i, docs); | 1061 | init_ObjectListIterator(&i, docs); |
1062 | } | 1062 | } |
1063 | } | 1063 | } |
1064 | iRelease(docs); | 1064 | iRelease(docs); |
1065 | } | 1065 | } |
1066 | 1066 | ||
1067 | iLocalDef iBool isWaitingAllowed_App_(iApp *d) { | 1067 | iLocalDef iBool isWaitingAllowed_App_(iApp *d) { |
@@ -1249,7 +1249,7 @@ void processEvents_App(enum iAppEventMode eventMode) { | |||
1249 | } | 1249 | } |
1250 | else if (ev.type == SDL_MOUSEMOTION) { | 1250 | else if (ev.type == SDL_MOUSEMOTION) { |
1251 | if (~ev.motion.state & SDL_BUTTON(SDL_BUTTON_LEFT)) { | 1251 | if (~ev.motion.state & SDL_BUTTON(SDL_BUTTON_LEFT)) { |
1252 | continue; /* only when pressing a button */ | 1252 | continue; /* only when pressing a button */ |
1253 | } | 1253 | } |
1254 | const float xf = (d->window->pixelRatio * ev.motion.x) / (float) d->window->size.x; | 1254 | const float xf = (d->window->pixelRatio * ev.motion.x) / (float) d->window->size.x; |
1255 | const float yf = (d->window->pixelRatio * ev.motion.y) / (float) d->window->size.y; | 1255 | const float yf = (d->window->pixelRatio * ev.motion.y) / (float) d->window->size.y; |
@@ -1263,7 +1263,7 @@ void processEvents_App(enum iAppEventMode eventMode) { | |||
1263 | ev.tfinger.fingerId = 0x1234; | 1263 | ev.tfinger.fingerId = 0x1234; |
1264 | ev.tfinger.pressure = 1.0f; | 1264 | ev.tfinger.pressure = 1.0f; |
1265 | ev.tfinger.timestamp = SDL_GetTicks(); | 1265 | ev.tfinger.timestamp = SDL_GetTicks(); |
1266 | ev.tfinger.touchId = SDL_TOUCH_MOUSEID; | 1266 | ev.tfinger.touchId = SDL_TOUCH_MOUSEID; |
1267 | } | 1267 | } |
1268 | } | 1268 | } |
1269 | #endif | 1269 | #endif |
@@ -1307,7 +1307,7 @@ void processEvents_App(enum iAppEventMode eventMode) { | |||
1307 | if (root) { | 1307 | if (root) { |
1308 | arrange_Widget(root->widget); | 1308 | arrange_Widget(root->widget); |
1309 | } | 1309 | } |
1310 | } | 1310 | } |
1311 | } | 1311 | } |
1312 | } | 1312 | } |
1313 | if (!wasUsed) { | 1313 | if (!wasUsed) { |
@@ -1374,11 +1374,11 @@ static int resizeWatcher_(void *user, SDL_Event *event) { | |||
1374 | if (event->type == SDL_WINDOWEVENT && event->window.event == SDL_WINDOWEVENT_SIZE_CHANGED) { | 1374 | if (event->type == SDL_WINDOWEVENT && event->window.event == SDL_WINDOWEVENT_SIZE_CHANGED) { |
1375 | const SDL_WindowEvent *winev = &event->window; | 1375 | const SDL_WindowEvent *winev = &event->window; |
1376 | #if defined (iPlatformMsys) | 1376 | #if defined (iPlatformMsys) |
1377 | resetFonts_Text(); { | 1377 | resetFonts_Text(text_Window(d->window)); { |
1378 | SDL_Event u = { .type = SDL_USEREVENT }; | 1378 | SDL_Event u = { .type = SDL_USEREVENT }; |
1379 | u.user.code = command_UserEventCode; | 1379 | u.user.code = command_UserEventCode; |
1380 | u.user.data1 = strdup("theme.changed auto:1"); | 1380 | u.user.data1 = strdup("theme.changed auto:1"); |
1381 | dispatchEvent_Window(d->window, &u); | 1381 | dispatchEvent_Window(as_Window(d->window), &u); |
1382 | } | 1382 | } |
1383 | #endif | 1383 | #endif |
1384 | drawWhileResizing_MainWindow(d->window, winev->data1, winev->data2); | 1384 | drawWhileResizing_MainWindow(d->window, winev->data1, winev->data2); |
@@ -1420,7 +1420,7 @@ void refresh_App(void) { | |||
1420 | #endif | 1420 | #endif |
1421 | const iPtrArray *windows = listWindows_App_(d); | 1421 | const iPtrArray *windows = listWindows_App_(d); |
1422 | /* Destroy pending widgets. */ { | 1422 | /* Destroy pending widgets. */ { |
1423 | iConstForEach(PtrArray, j, windows) { | 1423 | iConstForEach(PtrArray, j, windows) { |
1424 | iWindow *win = j.ptr; | 1424 | iWindow *win = j.ptr; |
1425 | setCurrent_Window(win); | 1425 | setCurrent_Window(win); |
1426 | iForIndices(i, win->roots) { | 1426 | iForIndices(i, win->roots) { |
@@ -1449,7 +1449,7 @@ void refresh_App(void) { | |||
1449 | break; | 1449 | break; |
1450 | default: | 1450 | default: |
1451 | draw_Window(win); | 1451 | draw_Window(win); |
1452 | break; | 1452 | break; |
1453 | } | 1453 | } |
1454 | } | 1454 | } |
1455 | } | 1455 | } |
@@ -1807,7 +1807,7 @@ static iBool handlePrefsCommands_(iWidget *d, const char *cmd) { | |||
1807 | updateFontButton_(findChild_Widget(d, "prefs.headingfont"), arg_Command(cmd)); | 1807 | updateFontButton_(findChild_Widget(d, "prefs.headingfont"), arg_Command(cmd)); |
1808 | return iFalse; | 1808 | return iFalse; |
1809 | } | 1809 | } |
1810 | else if (startsWith_CStr(cmd, "input.ended id:prefs.linespacing")) { | 1810 | else if (startsWith_CStr(cmd, "input.ended id:prefs.linespacing")) { |
1811 | /* Apply line spacing changes immediately. */ | 1811 | /* Apply line spacing changes immediately. */ |
1812 | const iInputWidget *lineSpacing = findWidget_App("prefs.linespacing"); | 1812 | const iInputWidget *lineSpacing = findWidget_App("prefs.linespacing"); |
1813 | postCommandf_App("linespacing.set arg:%f", toFloat_String(text_InputWidget(lineSpacing))); | 1813 | postCommandf_App("linespacing.set arg:%f", toFloat_String(text_InputWidget(lineSpacing))); |
@@ -1895,7 +1895,7 @@ static iBool handleIdentityCreationCommands_(iWidget *dlg, const char *cmd) { | |||
1895 | } | 1895 | } |
1896 | setFlags_Widget(pointer_Command(cmd), disabled_WidgetFlag, iTrue); | 1896 | setFlags_Widget(pointer_Command(cmd), disabled_WidgetFlag, iTrue); |
1897 | arrange_Widget(dlg); | 1897 | arrange_Widget(dlg); |
1898 | refresh_Widget(dlg); | 1898 | refresh_Widget(dlg); |
1899 | return iTrue; | 1899 | return iTrue; |
1900 | } | 1900 | } |
1901 | if (equal_Command(cmd, "ident.scope")) { | 1901 | if (equal_Command(cmd, "ident.scope")) { |
@@ -2027,7 +2027,7 @@ const iString *searchQueryUrl_App(const iString *queryStringUnescaped) { | |||
2027 | static void resetFonts_App_(iApp *d) { | 2027 | static void resetFonts_App_(iApp *d) { |
2028 | iConstForEach(PtrArray, win, listWindows_App_(d)) { | 2028 | iConstForEach(PtrArray, win, listWindows_App_(d)) { |
2029 | resetFonts_Text(text_Window(win.ptr)); | 2029 | resetFonts_Text(text_Window(win.ptr)); |
2030 | } | 2030 | } |
2031 | } | 2031 | } |
2032 | 2032 | ||
2033 | iBool handleCommand_App(const char *cmd) { | 2033 | iBool handleCommand_App(const char *cmd) { |
@@ -2875,7 +2875,7 @@ iBool handleCommand_App(const char *cmd) { | |||
2875 | write_Ipc(argLabel_Command(cmd, "pid"), | 2875 | write_Ipc(argLabel_Command(cmd, "pid"), |
2876 | collectNewFormat_String("%s\n", cstr_String(url_DocumentWidget(document_App()))), | 2876 | collectNewFormat_String("%s\n", cstr_String(url_DocumentWidget(document_App()))), |
2877 | response_IpcWrite); | 2877 | response_IpcWrite); |
2878 | return iTrue; | 2878 | return iTrue; |
2879 | } | 2879 | } |
2880 | else if (equal_Command(cmd, "ipc.signal")) { | 2880 | else if (equal_Command(cmd, "ipc.signal")) { |
2881 | if (argLabel_Command(cmd, "raise")) { | 2881 | if (argLabel_Command(cmd, "raise")) { |