summaryrefslogtreecommitdiff
path: root/src/ui/window.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/window.c')
-rw-r--r--src/ui/window.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/ui/window.c b/src/ui/window.c
index d6a41d3b..563d57ae 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -47,6 +47,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
47 47
48#include <the_Foundation/file.h> 48#include <the_Foundation/file.h>
49#include <the_Foundation/path.h> 49#include <the_Foundation/path.h>
50#include <the_Foundation/regexp.h>
50#include <SDL_hints.h> 51#include <SDL_hints.h>
51#include <SDL_timer.h> 52#include <SDL_timer.h>
52#include <SDL_syswm.h> 53#include <SDL_syswm.h>
@@ -419,9 +420,14 @@ static iBool handleNavBarCommands_(iWidget *navBar, const char *cmd) {
419 !isFocused_Widget(findWidget_App("lookup"))) { 420 !isFocused_Widget(findWidget_App("lookup"))) {
420 iString *newUrl = copy_String(text_InputWidget(url)); 421 iString *newUrl = copy_String(text_InputWidget(url));
421 trim_String(newUrl); 422 trim_String(newUrl);
422 postCommandf_App( 423 if (!isEmpty_String(&prefs_App()->searchUrl) && !isLikelyUrl_String(newUrl)) {
423 "open url:%s", 424 postCommandf_App("open url:%s", cstr_String(searchQueryUrl_App(newUrl)));
424 cstr_String(absoluteUrl_String(&iStringLiteral(""), collect_String(newUrl)))); 425 }
426 else {
427 postCommandf_App(
428 "open url:%s",
429 cstr_String(absoluteUrl_String(&iStringLiteral(""), collect_String(newUrl))));
430 }
425 return iTrue; 431 return iTrue;
426 } 432 }
427 } 433 }
@@ -1028,7 +1034,14 @@ static void invalidate_Window_(iWindow *d) {
1028} 1034}
1029 1035
1030static iBool isNormalPlacement_Window_(const iWindow *d) { 1036static iBool isNormalPlacement_Window_(const iWindow *d) {
1031 if (snap_Window(d) || d->isDrawFrozen) return iFalse; 1037 if (d->isDrawFrozen) return iFalse;
1038#if defined (iPlatformApple)
1039 /* Maximized mode is not special on macOS. */
1040 if (snap_Window(d) == maximized_WindowSnap) {
1041 return iTrue;
1042 }
1043#endif
1044 if (snap_Window(d)) return iFalse;
1032 return !(SDL_GetWindowFlags(d->win) & SDL_WINDOW_MINIMIZED); 1045 return !(SDL_GetWindowFlags(d->win) & SDL_WINDOW_MINIMIZED);
1033} 1046}
1034 1047
@@ -1161,7 +1174,7 @@ static iBool handleWindowEvent_Window_(iWindow *d, const SDL_WindowEvent *ev) {
1161 //updateRootSize_Window_(d, iTrue); 1174 //updateRootSize_Window_(d, iTrue);
1162 invalidate_Window_(d); 1175 invalidate_Window_(d);
1163 d->isMinimized = iFalse; 1176 d->isMinimized = iFalse;
1164 //printf("restored %d\n", snap_Window(d)); fflush(stdout); 1177 printf("restored %d\n", snap_Window(d)); fflush(stdout);
1165 return iTrue; 1178 return iTrue;
1166 case SDL_WINDOWEVENT_MINIMIZED: 1179 case SDL_WINDOWEVENT_MINIMIZED:
1167 d->isMinimized = iTrue; 1180 d->isMinimized = iTrue;