Author Topic: The 12 January 2019 build (11552) is out.  (Read 55348 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 12 January 2019 build (11552) is out.
« Reply #30 on: February 22, 2019, 07:07:31 pm »
4. Find out why flashing happens and eradicate it.  8) :o  ;D
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline New Pagodi

  • Multiple posting newcomer
  • *
  • Posts: 41
Re: The 12 January 2019 build (11552) is out.
« Reply #31 on: February 23, 2019, 12:19:23 am »
Quote
Plugins or wxAUI windows?

Will check.

The problem with wxSplashScreen is that it uses wxFRAME_TOOL_WINDOW and wxFRAME_NO_TASKBAR; both imply that no taskbar icon will be shown.

There are three possible solutions:
  1.- restore previous behaviour of the splash screen (icon in taskbar with flashing icons behind it)
  2.- no icon with splash screen and try to remove flashing icons for plugins/AUI windows
  3.- Icon with splash screen, try to remove flashing icons.

Option 1 is easy. Option 2 means no icon will be shown until the main window is opened, and may be less easy. 3 may be easy or not.

Which is the preferred way?

You can override wxWidgets' choices for window styles by calling winapi functions in the splash screen constructor.  Two things that look like they might be promising to me are to remove the WS_EX_APPWINDOW flag and add the WS_EX_NOACTIVATE flag.

Code
#ifdef __WXMSW__
    WXHWND hWnd = reinterpret_cast<WXHWND>(GetHandle());
    wxIntPtr winExStyle = ::GetWindowLongPtr(hWnd, GWL_EXSTYLE);
    winExStyle &= ~WS_EX_APPWINDOW;  // remove WS_EX_APPWINDOW flag
    winExStyle |= WS_EX_NOACTIVATE;  // add WS_EX_NOACTIVATE flag
    ::SetWindowLongPtr(hWnd, GWL_EXSTYLE, winExStyle);
#endif

The documentation for SetWindowLongPtr says

Quote
Certain window data is cached, so changes you make using SetWindowLongPtr will not take effect until you call the SetWindowPos function.

so you may have to add a line like this at the end

Code
    ::SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOREPOSITION|SWP_NOACTIVATE);

The only problem is you'll have to add user32.lib to the link libraries. I don't know how the codeblocks build system works, so that may or may not be a big problem.

relevant references:
GetWindowLongPtr
SetWindowLongPtr

Window Styles
Extended Window Styles

SetWindowPos

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1549
Re: The 12 January 2019 build (11552) is out.
« Reply #32 on: February 23, 2019, 11:28:25 am »
The icon appears and disappears when calling cbPlugin::OnAttach() within cbPlugin::Attach() (in cbplugin.cpp:73). The OnAttach() method is overriden by every plugin, so I think the problem is inside some of the plugins, probably when creating the log window.

I will explore further this weekend.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1549
Re: The 12 January 2019 build (11552) is out.
« Reply #33 on: February 25, 2019, 09:56:08 am »
The creator of the flashing icons is the compiler plugin; all the icons appears inside

Code
void CompilerGCC::DoRegisterCompilers()

with one icon for every call to

Code
CompilerFactory::RegisterCompiler(new Compiler....);

The RegisterCompiler method only inserts the new compiler in a list, so the problem must be inside the Compiler constructor.

EDIT: the icon appears while executing void Compiler::LoadDefaultOptions(const wxString& name, int recursion)
« Last Edit: February 25, 2019, 02:01:10 pm by Miguel Gimenez »

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1549
Re: The 12 January 2019 build (11552) is out.
« Reply #34 on: February 25, 2019, 02:51:24 pm »
OK, the problem is in compiler.cpp:1242. The call to wxExecute() makes the icon appear while the command is executing.
Adding the wxEXEC_HIDE_CONSOLE flag does not change anything.

EDIT: there is another call in complierMINGW.cpp:234
« Last Edit: February 25, 2019, 04:52:37 pm by Miguel Gimenez »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 12 January 2019 build (11552) is out.
« Reply #35 on: February 25, 2019, 07:46:42 pm »
Seems familiar... :(
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1549
Re: The 12 January 2019 build (11552) is out.
« Reply #36 on: February 26, 2019, 01:13:29 pm »
This patch solves the flashing icons issue with the compiler plugin in MSW. It does not modify the other platforms.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: The 12 January 2019 build (11552) is out.
« Reply #37 on: February 26, 2019, 09:01:46 pm »
This is one very brave patch.
You'll have to explain why this works because the patch contains just a single vague comment.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1549
Re: The 12 January 2019 build (11552) is out.
« Reply #38 on: February 27, 2019, 09:49:26 am »
This is the commented and revised patch. I changed the call to wxTheApp()->Yield() with Manager::Yield().

Tested in Windows 7 and Windows 10 with wx3.1.2.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1549
Re: The 12 January 2019 build (11552) is out.
« Reply #39 on: March 04, 2019, 01:49:59 pm »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: The 12 January 2019 build (11552) is out.
« Reply #40 on: March 09, 2019, 09:49:10 am »
a ticket only for you: https://sourceforge.net/p/codeblocks/tickets/796/ ;)
...unfortunately the patch attached (https://sourceforge.net/p/codeblocks/tickets/805/attachment/execute.patch) does not compile wit wx2.8.x.

The method wxTextInputStream::GetInputStream() is available since wx2.9.2 only.

The check on the parent (input stream) may work though but needs testing.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1549
Re: The 12 January 2019 build (11552) is out.
« Reply #41 on: March 09, 2019, 10:39:45 am »
Thank you for the revision. I have corrected the patch and posted it again in the ticket.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: The 12 January 2019 build (11552) is out.
« Reply #42 on: March 09, 2019, 11:07:26 am »
Thank you for the revision. I have corrected the patch and posted it again in the ticket.
I am testing this from now on. It may resolve another issue I was facing on Windows "on accident". Nag me if you like after a week or so to see if I figured out some unexpected problems. :-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1549
Re: The 12 January 2019 build (11552) is out.
« Reply #43 on: March 18, 2019, 09:21:11 am »
Nag me if you like after a week or so to see if I figured out some unexpected problems. :-)

Consider yourself nagged.  ;) Have you found any glitch?.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: The 12 January 2019 build (11552) is out.
« Reply #44 on: May 21, 2019, 07:40:15 pm »
Consider yourself nagged.  ;) Have you found any glitch?.
Not on Windows. It seems to work just fine. I would welcome people testing it on Linux?! My VM is too old by now... :-(
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ