Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-04

Patch: single button on taskbar (was: vote for single button IDE)

12 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Flávio Etrusco

2010/4/16 Silvio Clecio :

Show quoted text 15 lines
Fl?vio Etrusco escreveu: > I have a patch to fix the taskbar part of it (it's in mantis). Still > needs a patch to add an option to control it in the IDE ;-) > But there's the problem of Application.Active/Deactivate not working > correctly, which keeps window selection (bring other windows to front > on window selection) from working, but using DelayedDeactivate (using > AsyncQueueCall) sort of works. > > Fl?vio My desire is to see your patch native in future versions. Therefore I started the campaign with that vote to Linux users (Gnome or not). Thanks for your patch, greatly increased my productivity. ;)

Can somebody please take a look at the patch attached in http://bugs.freepascal.org/view.php?id=13537 and report any problems or questions back to me?

Best regards,
Fl?vio

Reply by email

Erwin van den Bosch
to Flávio Etrusco

I can't compile Lazarus anymore. (current svn trunk revision 24680)

I use > make clean all bigide
On opensuse 11.1 X86_64 and I use gtk2 widgets, fpc 2.4.0

This is the error output:

Compiling synhighlighterlfm.pas
synhighlighterlfm.pas(720,13) Error: Illegal type conversion: "^untyped" to "<enumeration type>"
synhighlighterlfm.pas(740) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
make[2]: *** [allsyneditunits.ppu] Fout 1
make[2]: Map '/home/erwin/fpc/lazarus/components/synedit' wordt verlaten make[1]: *** [synedit_all] Fout 2
make[1]: Map '/home/erwin/fpc/lazarus/components' wordt verlaten make: *** [components] Fout 2

Revision 24621 compiles fine. Revision 24622 and above gives this error.

Groetjes,
Erwin.

Reply by email

Martin
to Erwin van den Bosch
Erwin van den Bosch wrote 22 lines
I can't compile Lazarus anymore. (current svn trunk revision 24680) I use> make clean all bigide On opensuse 11.1 X86_64 and I use gtk2 widgets, fpc 2.4.0 This is the error output: Compiling synhighlighterlfm.pas synhighlighterlfm.pas(720,13) Error: Illegal type conversion: "^untyped" to "<enumeration type>" synhighlighterlfm.pas(740) Fatal: There were 1 errors compiling module, stopping Fatal: Compilation aborted make[2]: *** [allsyneditunits.ppu] Fout 1 make[2]: Map '/home/erwin/fpc/lazarus/components/synedit' wordt verlaten make[1]: *** [synedit_all] Fout 2 make[1]: Map '/home/erwin/fpc/lazarus/components' wordt verlaten make: *** [components] Fout 2 Revision 24621 compiles fine. Revision 24622 and above gives this error.
The line
   Result := TLfmCodeFoldBlockType(p);
should probably be:
   Result := TLfmCodeFoldBlockType(PtrUInt(p));

but it is interesting that neithe 2.4.0. nor 2.5.1 say anything about it here. Not even a a warning. Makes it hard to spot those oversights.....

Reply by email

Silvio Clecio
to Flávio Etrusco: 2010/4/16 Silvio Clecio : Can somebody please take a look at the patch attached in…
Fl?vio Etrusco wrote 6 lines
Can somebody please take a look at the patch attached in http://bugs.freepascal.org/view.php?id=13537 and report any problems or questions back to me? Best regards, Fl?vio

I'm using. Here (Ubuntu-9.10/FPC-2.2.4-3/Lazarus-0.9.28.2/GTK2) is working perfectly well :)

[]'s Silvio Cl?cio -- programmer ObjectPascal - http://silvioprog.com.br -- twitter - http://twitter.com/silvioprog -- Grupo Lazarus-BR no Google - http://groups.google.com/group/lazarus-br

Reply by email

Erwin van den Bosch
to Martin: The line Result := TLfmCodeFoldBlockType(p); should probably be: Result :=…

That helped a bit.
But also line 731. Same there.
After that it compiles ok!

"Typecasting pointers is such fun in object pascal! Why don't we go back to c++?" ;-)

Groetjes,
Erwin

Martin wrote 40 lines
On 17/04/2010 20:01, Erwin van den Bosch wrote: > I can't compile Lazarus anymore. (current svn trunk revision 24680) > > I use> make clean all bigide > On opensuse 11.1 X86_64 and I use gtk2 widgets, fpc 2.4.0 > > This is the error output: > > Compiling synhighlighterlfm.pas > synhighlighterlfm.pas(720,13) Error: Illegal type conversion: "^untyped" > to "<enumeration type>" > synhighlighterlfm.pas(740) Fatal: There were 1 errors compiling module, > stopping > Fatal: Compilation aborted > make[2]: *** [allsyneditunits.ppu] Fout 1 > make[2]: Map '/home/erwin/fpc/lazarus/components/synedit' wordt verlaten > make[1]: *** [synedit_all] Fout 2 > make[1]: Map '/home/erwin/fpc/lazarus/components' wordt verlaten > make: *** [components] Fout 2 > > > Revision 24621 compiles fine. Revision 24622 and above gives this error. > The line Result := TLfmCodeFoldBlockType(p); should probably be: Result := TLfmCodeFoldBlockType(PtrUInt(p)); but it is interesting that neithe 2.4.0. nor 2.5.1 say anything about it here. Not even a a warning. Makes it hard to spot those oversights..... -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Zaher Dirkey
to Silvio Clecio: I'm using. Here (Ubuntu-9.10/FPC-2.2.4-3/Lazarus-0.9.28.2/GTK2) is working perfectly well…
Silvio Clecio wrote 22 lines
Fl?vio Etrusco escreveu: > Can somebody please take a look at the patch attached in > http://bugs.freepascal.org/view.php?id=13537 and report any problems > or questions back to me? > > Best regards, > Fl?vio I'm using. Here (Ubuntu-9.10/FPC-2.2.4-3/Lazarus-0.9.28.2/GTK2) is working perfectly well :) -- []'s Silvio Cl?cio -- programmer ObjectPascal - http://silvioprog.com.br -- twitter - http://twitter.com/silvioprog -- Grupo Lazarus-BR no Google - http://groups.google.com/group/lazarus-br

In windows win32/XP i have window flicker (like the IDE hide and show) every time i open new dialog, for example the search dialog, is that depend on your patch?

Thanks in advance.

Zaher Dirkey

Reply by email

Martin
to Zaher Dirkey
Zaher Dirkey wrote 30 lines
On Sat, Apr 17, 2010 at 9:24 PM, Silvio Clecio wrote: > Fl?vio Etrusco escreveu: > >> Can somebody please take a look at the patch attached in >> http://bugs.freepascal.org/view.php?id=13537 and report any problems >> or questions back to me? >> >> Best regards, >> Fl?vio >> > I'm using. Here (Ubuntu-9.10/FPC-2.2.4-3/Lazarus-0.9.28.2/GTK2) is > working perfectly well :) > > -- > []'s > > Silvio Cl?cio > -- > programmer ObjectPascal - http://silvioprog.com.br > -- > twitter - http://twitter.com/silvioprog > -- > Grupo Lazarus-BR no Google - http://groups.google.com/group/lazarus-br > > In windows win32/XP i have window flicker (like the IDE hide and show) every time i open new dialog, for example the search dialog, is that depend on your patch?

The flicker is there anyway, once you moved a dialog.

Lazarus stores for each dialog where you had it last time. But unfortunately, those coordinates are only applied after the dialog is visble at it's designed position => flicker

Martin

Reply by email

Zaher Dirkey
to Martin
Martin wrote 46 lines
On 17/04/2010 21:44, Zaher Dirkey wrote: > On Sat, Apr 17, 2010 at 9:24 PM, Silvio Clecio > wrote: > > >> Fl?vio Etrusco escreveu: >> >> >>> Can somebody please take a look at the patch attached in >>> http://bugs.freepascal.org/view.php?id=13537 and report any problems >>> or questions back to me? >>> >>> Best regards, >>> Fl?vio >>> >>> >> I'm using. Here (Ubuntu-9.10/FPC-2.2.4-3/Lazarus-0.9.28.2/GTK2) is >> working perfectly well :) >> >> -- >> []'s >> >> Silvio Cl?cio >> -- >> programmer ObjectPascal - http://silvioprog.com.br >> -- >> twitter - http://twitter.com/silvioprog >> -- >> Grupo Lazarus-BR no Google - http://groups.google.com/group/lazarus-br >> >> >> > In windows win32/XP i have window flicker (like the IDE hide and show) > every time i open new dialog, for example the search dialog, is that > depend on your patch? > > The flicker is there anyway, once you moved a dialog. Lazarus stores for each dialog where you had it last time. But unfortunately, those coordinates are only applied after the dialog is visble at it's designed position => flicker

@Martin I meant the IDE forms not the my application form, @Silvio i decided it belong your patch, becuase i noticed you are use "UpdateShowInTaskBar" in some function, if we follow it to Win32 wedgets, it Hide the form then Show it, hiding the visible form get forcus to another forms and show it, before showed it, that make a flicker, You can see

  if Visible then
    ShowWindow(AForm.Handle, SW_HIDE);

I comment this line and build Lazarus IDE, the flicker is gone.

---------------
class procedure TWin32WSCustomForm.SetShowInTaskbar(const AForm:
TCustomForm;
  const AValue: TShowInTaskbar);
var
  Style: DWord;
  Visible, Active: Boolean;
begin
  if not WSCheckHandleAllocated(AForm, 'SetShowInTaskbar') then
    Exit;
  if (Application  nil) and (AForm = Application.MainForm) then
    Exit;
  // to apply this changes we need either to hide window or recreate it.
Hide is
  // less difficult
  Visible := IsWindowVisible(AForm.Handle);
  Active := GetForegroundWindow = AForm.Handle;
  if Visible then
    ShowWindow(AForm.Handle, SW_HIDE);
  Style := GetWindowLong(AForm.Handle, GWL_EXSTYLE);
  if AValue = stAlways then
    Style := Style or WS_EX_APPWINDOW
  else
    Style := Style and not WS_EX_APPWINDOW;
  SetWindowLong(AForm.Handle, GWL_EXSTYLE, Style);
  // now we need to restore window visibility with saving focus
  if Visible then
    if Active then
      ShowWindow(AForm.Handle, SW_SHOW)
    else
      ShowWindow(AForm.Handle, SW_SHOWNA);
end;
--------------

Best regards

Zaher Dirkey -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100419/48af7b8e/attachment.html>

Reply by email

Zaher Dirkey
to Zaher Dirkey
Look at
procedure TCustomForm.WMActivate(var Message : TLMActivate);
  // The button reappears in some situations (e.g. when the window gets the
  //"urgency" flag) so we hide it again here.
  // This is the most important place to invoke UpdateShowInTaskBar, since
  //invoking it anywhere else seeems basically useless/frequently reversed.
  if (ShowInTaskBar = stNever) or ((ShowInTaskBar = stDefault)
    and (Application.TaskBarBehavior = tbSingleButton)) then
  begin
    UpdateShowInTaskBar;
  end;
For non main form it hide and show every time the form is activated, when
use "Application.TaskBarBehavior := tbSingleButton" in the project.

I think the to resolve a problem in GTK2 "The button reappears in some situations"

Thanks

Zaher Dirkey -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100419/e9f88df9/attachment-0001.html>

Reply by email

Flávio Etrusco
to Zaher Dirkey

2010/4/19 Zaher Dirkey :

Show quoted text 23 lines
Look at procedure TCustomForm.WMActivate(var Message : TLMActivate); ? // The button reappears in some situations (e.g. when the window gets the ? //"urgency" flag) so we hide it again here. ? // This is the most important place to invoke UpdateShowInTaskBar, since ? //invoking it anywhere else seeems basically useless/frequently reversed. ? if (ShowInTaskBar = stNever) or ((ShowInTaskBar = stDefault) ??? and (Application.TaskBarBehavior = tbSingleButton)) then ? begin ??? UpdateShowInTaskBar; ? end; For non main form it hide and show every time the form is activated, when use "Application.TaskBarBehavior := tbSingleButton" in the project. I think the to resolve a problem in GTK2 "The button reappears in some situations" Thanks -- Zaher Dirkey

Thanks for testing it, Zaher.
I guess we'll have to add a check for
"WidgetSet.GetLCLCapability(lcNeedMininimizeAppWithMainForm)" in the code above, since the comments in TWin32WSCustomForm.SetShowInTaskbar suggest we can't eliminate the "hide" and I also see no WS-dependent way to determine whether we could skip SetShowInTaskbar when the value is already correct...

-Fl?vio

Reply by email

Silvio Clecio
to Zaher Dirkey: @Martin I meant the IDE forms not the my application form, @Silvio i decided it belong…

Zaher Dirkey escreveu:
[...]

@Silvio i decided it belong your patch, becuase i noticed you are use "UpdateShowInTaskBar" in some function, if we follow it to Win32

[...]

Hellow Zaher :)

I tested only on Linux(Ubuntu) :/

Gave an error when compiling, but I created .lfm (msgview.lfm) and compiled normal.

[]'s Silvio Cl?cio -- programmer ObjectPascal - http://silvioprog.com.br -- twitter - http://twitter.com/silvioprog -- Grupo Lazarus-BR no Google - http://groups.google.com/group/lazarus-br

Reply by email

Silvio Clecio
to Flávio Etrusco: 2010/4/19 Zaher Dirkey : Thanks for testing it, Zaher. I guess we'll have to add a check…
Fl?vio Etrusco wrote 34 lines
2010/4/19 Zaher Dirkey : > Look at > procedure TCustomForm.WMActivate(var Message : TLMActivate); > > // The button reappears in some situations (e.g. when the window gets the > //"urgency" flag) so we hide it again here. > // This is the most important place to invoke UpdateShowInTaskBar, since > //invoking it anywhere else seeems basically useless/frequently reversed. > if (ShowInTaskBar = stNever) or ((ShowInTaskBar = stDefault) > and (Application.TaskBarBehavior = tbSingleButton)) then > begin > UpdateShowInTaskBar; > end; > > For non main form it hide and show every time the form is activated, when > use "Application.TaskBarBehavior := tbSingleButton" in the project. > > I think the to resolve a problem in GTK2 "The button reappears in some > situations" > > Thanks > -- > Zaher Dirkey > Thanks for testing it, Zaher. I guess we'll have to add a check for "WidgetSet.GetLCLCapability(lcNeedMininimizeAppWithMainForm)" in the code above, since the comments in TWin32WSCustomForm.SetShowInTaskbar suggest we can't eliminate the "hide" and I also see no WS-dependent way to determine whether we could skip SetShowInTaskbar when the value is already correct... -Fl?vio

My friends, I am very happy to see you determined to solve this problem. This feature will help in productivity of many users who use Lazarus on Linux (Ubuntu).

For you have an idea, look at the amount of downloads of DEB packages:

http://sourceforge.net/projects/lazarus/files/

Veeery thanks! :)

[]'s Silvio Cl?cio -- programmer ObjectPascal - http://silvioprog.com.br -- twitter - http://twitter.com/silvioprog -- Grupo Lazarus-BR no Google - http://groups.google.com/group/lazarus-br

Reply by email