<p style="padding:0 0 0 0; margin:0 0 0 0;">I found the reason but to make a patch is beyond my powers.</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">When I used the steps described below, I got this in console:</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">NOTE: Window with stalled focus found!, faking focus-out event</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">NOTE: Window with stalled focus found!, faking focus-out event</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux-gtk2 New=x86_64-linux-qt FPC=False LCL=True</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">HERE1 lpQT</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux-qt New=x86_64-linux-gtk2 FPC=False LCL=True</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">HERE2 lpQT</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">HERE3 lpQT</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux-gtk2 New=x86_64-linux-qt FPC=False LCL=True</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Note: (lazarus) deleted backup "/home/v1/Lazarus_Qt/lazarus/lazarus.old"</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Note: (lazarus) renamed file "/home/v1/Lazarus_Qt/lazarus/lazarus" to "/home/v1/Lazarus_Qt/lazarus/lazarus.old"</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Info: (lazarus) Execute Title="Build IDE"</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Info: (lazarus) Working Directory="/home/v1/Lazarus_Qt/lazarus/"</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Info: (lazarus) Executable="/usr/bin/make"</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Info: (lazarus) Param[0]="idepkg"</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Info: (lazarus) Param[1]="-w"</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">HERE4 lpQT</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux-qt New=x86_64-linux-gtk2 FPC=False LCL=True</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">HERE5 lpQT</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Hint: (lazarus) TMainIDE.DoRestart </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">LAZARUS END - cleaning up ...</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Hint: (lazarus) [TMainIDE.Destroy] B -> inherited Destroy... TMainIDE</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Hint: (lazarus) [TMainIDE.Destroy] END</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Heap dump by heaptrc unit</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">3185022 memory blocks allocated : 308622317/315523376</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">3185022 memory blocks freed : 308622317/315523376</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">0 unfreed memory blocks : 0</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">True heap size : 1572864</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">True free heap : 1572864</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">TLazarusManager.Run starting /home/v1/Lazarus_Qt/lazarus/lazarus ...</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] PrimaryConfigPath="/home/v1/.lazarus"</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Hint: (lazarus) [TMainIDE.ParseCmdLineOptions] SecondaryConfigPath="/etc/lazarus"</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-linux-gtk2 New=x86_64-linux-gtk2 FPC=True LCL=False</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">TComponentTreeView.SetSelection: Updating component node values.</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">TLazSourceFileManager.InitOpenedProjectFile select form in designer: Form1:TForm1 TDesigner</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">NOTE: Window with stalled focus found!, faking focus-out event</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">NOTE: Window with stalled focus found!, faking focus-out event</p>
<div>See several "Hint:<span style="font-size: 13.3333px;"> </span><span style="font-size: 13.3333px;">(lazarus) [TBuildManager.SetBuildTarget]..." about changing widgetset.</span></div>
<div><span style="font-size: 13.3333px;">Lines "HEREx lpQt" are from me, they indicates that state of MiscellaneousOptions.BuildLazProfiles.Current.TargetPlatform); is unchanged</span></div>
<div>The changes come from method MainBuildBoss.SetBuildTargetProject1 which is called several times in main.pp, mainly in TMainIDE.mnuToolConfigBuildLazClicked at line 4595.</div>
<div>It calls TBuildManager.SetBuildTarget and nested function GetEffectiveLCLWidgetType where is line: Result:=FBuildTarget.CompilerOptions.GetEffectiveLCLWidgetType</div>
<div>It is probably the reason why combobox in "Configure Build Lazarus" is ignored and is replaced by value from Compiler Options.</div>
<div>V.</div>
<p style="padding:0 0 0 0; margin:0 0 0 0;">______________________________________________________________<br />
> Od: Vojtěch Čihák via Lazarus<br />
> Komu: Lazarus mailing list <lazarus@lists.lazarus-ide.org><br />
> Datum: 02.01.2018 22:21<br />
> Předmět: Re: [Lazarus] Rebuilding IDE Gtk/Qt<br />
></p>
<p style="padding: 0 0 0 0; margin: 0 0 0 0;">Thanks to zeljko for confirming.</p>
<p style="padding: 0 0 0 0; margin: 0 0 0 0;"> </p>
<p style="padding: 0 0 0 0; margin: 0 0 0 0;">I was able to reproduce right now:</p>
<p style="padding: 0 0 0 0; margin: 0 0 0 0;"> </p>
<p style="padding: 0 0 0 0; margin: 0 0 0 0;">I have my Lazarus 1.9.0 r56925M FPC 3.0.4 x86_64-linux-qt.</p>
<p style="padding: 0 0 0 0; margin: 0 0 0 0;">I started new project. I saved it. I open Project Options -> Addition and Overrides and added LCLWidgetType "gtk2".</p>
<p style="padding: 0 0 0 0; margin: 0 0 0 0;">I run the project once just to see it is really GTk2 - it is.</p>
<p style="padding: 0 0 0 0; margin: 0 0 0 0;">Now I enter Tools -> Configure Bulid Lazarus. Options are Debug IDE, LCL WIdgetType = qt. I don't change them.</p>
<p style="padding: 0 0 0 0; margin: 0 0 0 0;">I switch to "Clean common files" and click Build.</p>
<p style="padding: 0 0 0 0; margin: 0 0 0 0;">After restart I have Lazarus 1.9.0 r56925M FPC 3.0.4 x86_64-linux-gtk2.</p>
<p style="padding: 0 0 0 0; margin: 0 0 0 0;"> </p>
<p style="padding: 0 0 0 0; margin: 0 0 0 0;">V.</p>
<p style="padding: 0 0 0 0; margin: 0 0 0 0;"> </p>
_______________________________________________<br />
Lazarus mailing list<br />
Lazarus@lists.lazarus-ide.org<br />
<a href="https://lists.lazarus-ide.org/listinfo/lazarus">https://lists.lazarus-ide.org/listinfo/lazarus</a><br />
<br />
<br />
----------<br />
<br />
-- <br />
_______________________________________________<br />
Lazarus mailing list<br />
Lazarus@lists.lazarus-ide.org<br />
<a href="https://lists.lazarus-ide.org/listinfo/lazarus">https://lists.lazarus-ide.org/listinfo/lazarus</a><br />