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

Zaher Dirkey parmaja at gmail.com
Mon Apr 19 08:49:27 CEST 2010


On Sat, Apr 17, 2010 at 11:39 PM, Martin <lazarus at mfriebe.de> wrote:

> On 17/04/2010 21:44, Zaher Dirkey wrote:
>
>> On Sat, Apr 17, 2010 at 9:24 PM, Silvio Clecio<silvioprog at gmail.com>
>>  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-ide.org/pipermail/lazarus/attachments/20100419/48af7b8e/attachment-0004.html>


More information about the Lazarus mailing list