From 959307033e7fa771e319e75b949365f28d92d628 Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Tue, 17 Oct 2017 02:29:47 -0200 Subject: [PATCH] Avoid moving the IDE window to 0,0 in the first run (Windows). --- source/global/IDEsettings.bas | 7 +++---- source/qb64.bas | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/source/global/IDEsettings.bas b/source/global/IDEsettings.bas index 2cebdaa99..9a34490f8 100644 --- a/source/global/IDEsettings.bas +++ b/source/global/IDEsettings.bas @@ -4,6 +4,7 @@ DIM SHARED IDEBackgroundColor AS _UNSIGNED LONG DIM SHARED IDEBackgroundColor2 AS _UNSIGNED LONG, IDEBracketHighlightColor AS _UNSIGNED LONG DIM SHARED IDEKeywordColor AS _UNSIGNED LONG, IDENumbersColor AS _UNSIGNED LONG DIM SHARED IDE_AutoPosition AS _BYTE, IDE_TopPosition AS INTEGER, IDE_LeftPosition AS INTEGER +DIM SHARED IDE_BypassAutoPosition AS _BYTE DIM SHARED IDENormalCursorStart AS LONG, IDENormalCursorEnd AS LONG DIM SHARED IDE_Index$ DIM SHARED LoadedIDESettings AS INTEGER @@ -247,7 +248,7 @@ IF LoadedIDESettings = 0 THEN IF result THEN IDE_TopPosition = VAL(value$) ELSE - IDE_Autopostion = 0 'If there's no position saved in the file, then we certainly don't need to try and auto-position to our last setting. + IDE_BypassAutoPosition = -1 'If there's no position saved in the file, then we certainly don't need to try and auto-position to our last setting. IDE_TopPosition = 0 WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_TopPosition", "0" END IF @@ -256,7 +257,7 @@ IF LoadedIDESettings = 0 THEN IF result THEN IDE_LeftPosition = VAL(value$) ELSE - IDE_Autopostion = 0 'If there's no position saved in the file, then we certainly don't need to try and auto-position to our last setting. + IDE_BypassAutoPosition = -1 'If there's no position saved in the file, then we certainly don't need to try and auto-position to our last setting. IDE_LeftPosition = 0 WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_LeftPosition", "0" END IF @@ -407,8 +408,6 @@ IF LoadedIDESettings = 0 THEN WriteConfigSetting "'[IDE COLOR SETTINGS]", "QuoteColor", "_RGB32(255,255,85)" WriteConfigSetting "'[IDE COLOR SETTINGS]", "TextColor", "_RGB32(255,255,255)" IF INSTR(_OS$, "WIN") THEN - WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_TopPosition", "0" - WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_LeftPosition", "0" WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_AutoPosition", "TRUE" END IF WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_Width", "80" diff --git a/source/qb64.bas b/source/qb64.bas index 2fdce9f8a..ec77b9b50 100644 --- a/source/qb64.bas +++ b/source/qb64.bas @@ -915,7 +915,7 @@ gl_scan_header '-----------------------QB64 COMPILER ONCE ONLY SETUP CODE ENDS HERE--------------------------------------- IF NoIDEMode THEN IDE_AutoPosition = 0: GOTO noide -IF IDE_AutoPosition THEN _SCREENMOVE IDE_LeftPosition, IDE_TopPosition +IF IDE_AutoPosition AND NOT IDE_BypassAutoPosition THEN _SCREENMOVE IDE_LeftPosition, IDE_TopPosition idemode = 1 sendc$ = "" 'no initial message IF CMDLineFile <> "" THEN sendc$ = CHR$(1) + CMDLineFile