Forum > Operating Systems

(Solved)Modal window won't become fullscreen on linux(Ubuntu)


Hello everyone,

I've been trying to make a fullscreen window application that works both on Windows and Linux. Thanks to everyone who share the information, I've manage to figure this out.

However, the problem is that, on Ubuntu, modal window won't become fullscreen. "Top bar" and "Dock" won't hide. Normal window can become fullscreen without problem. On windows, both normal and modal windows can be fullscreen without a problem.

Is there any work around?

I've attached a screenshot and the minimum project which you can recreate this.

Thank you!

Windows 10:
Lazarus 1.8.0 r56594 FPC 3.0.4 x86_64-win64-win32/win64

Ubuntu 17.10:
Lazarus 1.8.0 rc4+dfsg-1 FPC 3.0.2 x86_64-linux-gtk2

Uhh.. I got it. The trick was...

DON'T use WindowState:=wsFullScreen; if the form is modal.

So, here is the new cross platform way of making fullscreen window.

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm2.SetFullScreen_Universal();begin  if FisFullscreen then  begin    //turn fullscreen off.    WindowState:= FOrigWndState;    {$ifdef windows}    BorderStyle:= bsSizeable;  //don't do this at runtime on linux!    {$endif}    ShowWindow(Handle, SW_SHOWNORMAL);    BoundsRect:= FOrigBounds;     //set flag    FisFullscreen := false;  end else  begin    //save original windowstate    FOrigWndState:= WindowState;    FOrigBounds := BoundsRect;     //turn fullscreen on.    //WindowState:=wsFullScreen; //don't do this if the form is modal on linux.    {$ifdef windows}    BorderStyle:= bsNone;  //don't do this at runtime on linux!    {$endif}    BoundsRect:= Monitor.BoundsRect;    ShowWindow(Handle, SW_SHOWFULLSCREEN);     //set flag    FisFullscreen := true;  end;end;       


[0] Message Index

Go to full version