http://bugs.winehq.org/show_bug.cgi?id=24757
Summary: Form can not be deactivated using SetWindowLong Product: Wine Version: 1.3.2 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdi32 AssignedTo: wine-bugs@winehq.org ReportedBy: alejandro.lavarello@gmail.com
With SetWindowLong one can make a window that never activates, e.g., never gets focused and stay below the others. This works OK in Windows XP, but do not work in Wine. This is the Lazarus code, that once compiled, makes an application that works in Windows but not in Wine:
----begin code --------
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Windows, Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
StdCtrls, ExtCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
Timer1: TTimer;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
i:integer;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
begin
i:=0;
Timer1.Interval :=5000;
Timer1.Enabled :=True;
Edit1.Text :='Init';
Self.ShowInTaskBar :=stNever;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
i:=i+1;
Edit1.Text :='Click number: '+IntToStr(i);
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
Edit1.text:='Form with style = WS_EX_NOACTIVATE';
SetWindowLong(self.Handle , GWL_EXSTYLE, WS_EX_NOACTIVATE);
Timer1.Enabled :=False;
end;
END.
----end code ----------
Tested in Wine 1.3.2 under Puppy Linux 4.3.1 and in WineXO under Sugar in a XO-1.
http://bugs.winehq.org/show_bug.cgi?id=24757
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|gdi32 |-unknown Summary|Form can not be deactivated |WS_EX_NOACTIVATE doesn't |using SetWindowLong |prevent window activation Severity|normal |minor
--- Comment #1 from Dmitry Timoshkov dmitry@codeweavers.com 2010-10-16 06:50:54 CDT --- What's the Lazarus? Is there a download link?
It would be much better if you would attach the sample code instead of pasting it.
http://bugs.winehq.org/show_bug.cgi?id=24757
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |source
--- Comment #2 from Austin English austinenglish@gmail.com 2010-10-17 20:23:01 CDT --- A compiled exe would also be helpful.
http://bugs.winehq.org/show_bug.cgi?id=24757
--- Comment #3 from Alejandro Lavarello alejandro.lavarello@gmail.com 2010-10-17 23:22:32 CDT --- (In reply to comment #1)
What's the Lazarus? Is there a download link?
It would be much better if you would attach the sample code instead of pasting it.
Hi, Dmitry. You can download the source code plus a compiled exe showing the problem in:
http://www.megaupload.com/?d=UJVR3MSM
This is 2.46 MB RAR file. Inside you get project1.exe that exhibits the bug of Wine.
http://bugs.winehq.org/show_bug.cgi?id=24757
--- Comment #4 from Alejandro Lavarello alejandro.lavarello@gmail.com 2010-10-17 23:36:09 CDT --- Created an attachment (id=31359) --> (http://bugs.winehq.org/attachment.cgi?id=31359) Correct working of WS_EX_NOACTIVATE in Windows XP
In Windows XP, the form never comes to front when clic in it. This is the correct behaviour of the call to the Windows API SetWindowLong(self.Handle , GWL_EXSTYLE, WS_EX_NOACTIVATE). (Programming language: Lazarus Free Pascal).
http://bugs.winehq.org/show_bug.cgi?id=24757
--- Comment #5 from Alejandro Lavarello alejandro.lavarello@gmail.com 2010-10-17 23:55:58 CDT --- Created an attachment (id=31360) --> (http://bugs.winehq.org/attachment.cgi?id=31360) Bad behaviour of SetWindowLong in Wine
In Wine, the call to the Windows API SetWindowLong with parameter WS_EX_NOACTIVATE do not work.
http://bugs.winehq.org/show_bug.cgi?id=24757
--- Comment #6 from Dmitry Timoshkov dmitry@codeweavers.com 2010-10-18 02:24:39 CDT --- (In reply to comment #3)
http://www.megaupload.com/?d=UJVR3MSM
This is 2.46 MB RAR file. Inside you get project1.exe that exhibits the bug of Wine.
A maximally simplified test attached to this bug report is preferred.
http://bugs.winehq.org/show_bug.cgi?id=24757
--- Comment #7 from Alexandre Julliard julliard@winehq.org 2010-10-18 04:00:27 CDT --- Works fine here. The behavior depends on the window manager, so if yours doesn't respect the hints we set there's nothing we can do.
http://bugs.winehq.org/show_bug.cgi?id=24757
--- Comment #8 from Alejandro Lavarello alejandro.lavarello@gmail.com 2010-10-18 07:19:07 CDT --- (In reply to comment #7)
Works fine here. The behavior depends on the window manager, so if yours doesn't respect the hints we set there's nothing we can do.
In which window manager this function work? This do not work in XO-1 with Fedora Remix + Sugar, and not work in Puppy Linux 4.3.1.
http://bugs.winehq.org/show_bug.cgi?id=24757
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID
--- Comment #9 from Alexandre Julliard julliard@winehq.org 2010-10-18 07:57:01 CDT --- The window doesn't get activated, tested with fvwm, metacity and kwin. It still gets brought to the front on some window managers, that's window manager policy, nothing we can do about it. You can try to configure your wm if you want to change the behavior.
http://bugs.winehq.org/show_bug.cgi?id=24757
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #10 from Dmitry Timoshkov dmitry@codeweavers.com 2010-10-18 08:11:26 CDT --- Closing invalid.