Dialog box goes behind document

I am stuck.
Libreoffice 24.2.7.2 Ubuntu 24.04.2
I have xrayed the dialog box but cannot find a method of keeping the dialog box in front of the document after a button on the dialog box makes the document full screen. Perhaps it is not possible?
I hope someone can help.
How to get the dialog box to stay on top of the document after making the document full screen using a button in the dialog box

this is my macro
REM ***** BASIC *****

Dim TestD As Object
Dim Continue As Boolean

'*********************************************************************

Sub StartTestDialog

Dim Doc As Object
Dim Sheet As Object
Dim Controller As Object
Dim frame As Object

Dim TestListenerTop as object
'Dim SeasonBox As Object

Doc = ThisComponent
frame = doc.CurrentController.getFrame()

Continue = true

DialogLibraries.LoadLibrary(“Standard”)
’ load standard library

TestD = CreateUnoDialog(DialogLibraries.Standard.Test)

'xray Doc
'xray frame
'xray TestD
'xray Sheet

TestListenerTop=createUnoListener(“TopTestListen_”, “com.sun.star.awt.XTopWindowListener”)
TestD.addTopWindowlistener(TestListenerTop)

do while Continue
wait 20
TestD.setVisible(true)
loop
TestD.setVisible(false)

End Sub

'***********************************************************

Sub MakeFullScreen

Dim Doc As Object
Dim Sheet As Object
Dim Frame As Object
Dim Dispatcher As Object
Dim HelpTXT As Object

Doc = ThisComponent

frame = doc.CurrentController.getFrame()
dispatcher = createUnoService(“com.sun.star.frame.DispatchHelper”)
dispatcher.executeDispatch(frame, “.uno:FullScreen”, “”, 0, Array())

’ Continue = False

End Sub

Sub Finished

Continue = false

End sub

'*****************************************************

sub TopTestListen_WindowClosing
Continue=false
end sub
sub TopTestListen_windowOpened
end sub
sub TopTestListen_windowClosed
end sub
sub TopTestListen_windowMinimized
end sub
sub TopTestListen_windowNormalized
end sub
sub TopTestListen_windowActivated
end sub
sub TopTestListen_windowDeactivated
end sub
sub TopTestListen_disposing
end sub

'*******************
MakeFullScreenDialog.ods (14.5 KB)

firstly : Ask/Guide - How to use the Ask site - The Document Foundation Wiki #More_details

secondly : Ask/Guide - How to use the Ask site - The Document Foundation Wiki #Are_there_any_answers_to_my_question_yet


then, likely :
91797 – "Find & Replace" dialog doesnt open with shortcut in full screen mode
Writer : Find dialog not raising in Full Screen - #2 by RGB-es

I think you must to change your theme tag from Calc to Macros

Thank you for your help. I have now posted it to macros and calc, I hope?

Try this pencil:

I see dlg always in front under Win10, but try to add the line to Sub MakeFullScreen:

dispatcher.executeDispatch(frame, ".uno:FullScreen", "", 0, Array())
TestD.toFront() 'dialog to front

Thank you KamilLanda for the suggestion
Unfortunately adding that line still leaves the dialog behind the document. Perhaps linux has differences with windows.

I have now tried the program with windows and it works correctly. So either the ubuntu system is at fault or perhaps I need to update libreoffice.
The command
TestD.toFront()
has no effect that I can see. I will have to use another method to get the document full screen.
Thank you for your help.

Try to run the dialog this way.
I can see the dialog when switching to full-screen mode.

Many thanks for your attention.
I am afraid i did not understand the answer.
I have now uploaded the file. When the dialog is open the doc can be made full screen but then the dialog disappears behind the doc. Pressing esc will stop full screen and then the doc can move to reveal the dialog.

Have you tried this experiment with my file?

Thank you for your suggestion.
I am sorry I did not understand how to use your file with my macro. I am having difficulty getting to grips with the commands.

I tested your file and my file on several configurations and everything worked correctly.
One of the configurations:

Version: 24.8.4.2 (X86_64) / LibreOffice Community
Build ID: 480(Build:2)
CPU threads: 4; OS: Linux 6.1; UI render: default; VCL: kf5 (cairo+xcb)
Locale: ru-RU (ru_RU.UTF-8); UI: ru-RU
Debian package version: 4:24.8.4~rc2-0ubuntu0.22.04.1~lo1+ci202412261228+astra3+ci5
Calc: threaded

Open the file Dlglib.ods and run macro ShowNMDialog. A dialog should appear in non-modal mode. Then switch the application to full-screen mode via the corresponding menu item.
If the dialog does not disappear, then we will continue to search for the causes of your problems.
The dialog in the Dlglib.ods file is created in a different way than in your file.
Also please provide information about your system (Menu / Help / About…).

I apologise for my delay in responding.
The macro works correctly with windows and does not work with ubuntu.
Many thanks for your assistance with this. I have decided to make the document full screen in another way.
I dont know how to close the issue.
Best wishes