diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/fpg_main.pas | 2 | ||||
-rw-r--r-- | src/corelib/x11/fpg_x11.pas | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/corelib/fpg_main.pas b/src/corelib/fpg_main.pas index 537138fb..ee05655a 100644 --- a/src/corelib/fpg_main.pas +++ b/src/corelib/fpg_main.pas @@ -1136,7 +1136,7 @@ end; function fpgApplication: TfpgApplication; begin if not Assigned(uApplication) then - uApplication := TfpgApplication.Create(ParamStr(1)); + uApplication := TfpgApplication.Create; result := uApplication; end; diff --git a/src/corelib/x11/fpg_x11.pas b/src/corelib/x11/fpg_x11.pas index 8dce37cf..f36b0db4 100644 --- a/src/corelib/x11/fpg_x11.pas +++ b/src/corelib/x11/fpg_x11.pas @@ -400,6 +400,7 @@ uses fpg_stringutils, // used for GetTextWidth fpg_utils, fpg_form, // for modal event support + fpg_cmdlineparams, cursorfont, xatom, // used for XA_WM_NAME keysym, @@ -1328,10 +1329,19 @@ begin end; constructor TfpgX11Application.Create(const AParams: string); +var + s: string; begin inherited Create(AParams); FIsInitialized := False; - FDisplay := XOpenDisplay(PChar(aparams)); + + if gCommandLineParams.IsParam('display') then + begin + s := gCommandLineParams.GetParam('display'); + FDisplay := XOpenDisplay(PChar(s)); + end + else + FDisplay := XOpenDisplay(''); if FDisplay = nil then raise Exception.Create('fpGUI-X11: Could not open the display. Is your X11 server running?'); |