← Back to team overview

kicad-developers team mailing list archive

Re: eeschema modular kicad work

 


Le 14/08/2014 16:21, Dick Hollenbeck a écrit :
I don't know if it is technically possible to change this behaviour, but
I think it could be a great improvement.

:
yann

Hopefully QuasiModal is not a monster.

For significant dialogs (ones which tend to be open for a while) using the QuasiModal
support in DIALOG_SHIM might be a solution to this.  It disables the window which invokes
the dialog, but nothing more.

Without the QuasiModal support, the behaviour is platform specific.  On linux, I *CAN*
open the schematic editor while viewing footprint properties and scroll, but I cannot
close the schematic window.  So that behaviour is arguably worse, since it looks like a
bug.  (It is not a bug that I would respond to.  Let's register it as folklore.)

Hi Dick,

This sounds pretty strange : I'm on linux too, and I can't. Kicad main window frozen when dialog opened in pcbnew.


Remember if you cannot close a major KIWAY_PLAYER using system window decorations, this
might be because you have a dialog window opened elsewhere on linux.

Please see if this patch fixes the sample issue for you.  The QuasiModal support was
something I came up with using only the wxWindows API, not a platform specific approach.
I don't know that its been tested enough across all platforms.  Bad news is that there may
not be anything I can do except for Linux to fix it, should it not work wonderfully on all
platforms.



Patch solved the issue, seemed to work like a charm... But induced another issue. Step to reproduce :

1 - open kicad, then open eeschema and pcbnew
2 - in pcbnew, open the module properties dialog on any part you want.
3 - go back to eeschema, wich is now responding normally, and open the component properties dialog, on the same part or another one (doesn't matters). 4 - go back to pcbnew, close the dialog, either with OK or Cancel --> dialog closes, but pcbnew is frozen and also can't be closed in any normal way. eeschema still works, you can close the dialog and use it normally. Kicad main window works also. Eeschema can be closed normally, kicad main window also, but when closing main window, pcbnew window closes too, but the kicad process is still there and you need to kill it.

I thought I will modify eeschema in the same way to test if it does something else, and so I noticed the eeschema component properties dialog was alredy a QuasiModal one.

And obviously the same test starting with eeschema instead of pcbnew leads to to opposite result : eeschema stuck, pcbnew working.
And again, the need to kill kicad process after closing the main window.

During that test, the following error appears some times :

(kicad:10263): Gtk-CRITICAL **: IA__gtk_widget_add_accelerator: assertion 'GTK_IS_WIDGET (widget)' failed


This was tested with bzr5049 :

Application: kicad
Version: (2014-08-04 BZR 5049)-product Release build
wxWidgets: Version 2.8.12 (release,Unicode,compiler with C++ ABI 1002,GCC 4.8.1,wx containers,compatible with 2.6)
Platform: Linux 3.13.0-34-generic i686, 32 bit, Little endian, wxGTK
Boost version: 1.54.0
         USE_WX_GRAPHICS_CONTEXT=OFF
         USE_WX_OVERLAY=OFF
         KICAD_SCRIPTING=OFF
         KICAD_SCRIPTING_MODULES=OFF
         KICAD_SCRIPTING_WXPYTHON=OFF
         USE_FP_LIB_TABLE=HARD_CODED_ON
         BUILD_GITHUB_PLUGIN=ON


I updated my source tree to latest bzr to test with that revision, but I did a mistake and I need to recompile the whole stuff. As I have only my netbook now, it will take one hour or more, so I will test that tomorow....

Regards,

Yann

If this patch works wonderfully, then someone wanting to contribute more of the same style
is welcome to.  Simply consider ShowModal() and EndModal() to be a matched set.  Replace
them with ShowQuasiModal() and EndQuasiModal() respectively.  Do not mix, keep the set
matched.

For me, not all dialogs are likely to be as *prominent* as others, i.e. their lifetimes.
In some cases we've used modeless dialogs.  That makes sense where we've used it, but it
requires an entirely different coding style from modal and quasimodal.  So injecting this
kind of quasimodal patch is easier than going full modal.

It might be prudent to introduce a couple of macros

#define ENDQUASIMODAL	EndQuasiModal
#define SHOWQUASIMODAL	ShowQuasiModal

So this can be turned off globally and revert to true modal if something bad gets
discovered down the line.  Then after enough testing we can do global search and replace
and jump off the macros.


Dick



_______________________________________________
Mailing list: https://launchpad.net/~kicad-developers
Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Follow ups

References