B4J Question How to move an window to linux desktop outside

chjk

Member
Licensed User
Longtime User
How to move an window to linux desktop outside, Now we can only move windows within the desktop!

B4X:
Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form
    Private xui As XUI
    Private Button1 As B4XView
    Private ox, oy As Double
End Sub

Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    MainForm.RootPane.LoadLayout("Layout1")
    MainForm.SetFormStyle ("TRANSPARENT")
    MainForm.BackColor = fx.Colors.Transparent
    MainForm.Show
End Sub

Sub Button1_Click
    MainForm.Close
End Sub

Private Sub MainForm_MousePressed (EventData As MouseEvent)
    ox = EventData.X
    oy = EventData.Y
End Sub

Private Sub MainForm_MouseDragged (EventData As MouseEvent)
    Dim jo As JavaObject = EventData
    MainForm.WindowLeft = jo.RunMethod("getScreenX", Null) - ox
    MainForm.WindowTop = jo.RunMethod("getScreenY", Null) - oy
End Sub
 

Attachments

  • moveWin.zip
    27.8 KB · Views: 11
  • moveWin.png
    moveWin.png
    221.9 KB · Views: 35
Last edited:

chjk

Member
Licensed User
Longtime User
Not sure that I understand. Can it move if it is a regular window?
Yes, A regular window drag window title bar can move desktop outside,but MainForm.SetFormStyle ("TRANSPARENT"), drag window only move windows within the desktop!
 

Attachments

  • moveWin.png
    moveWin.png
    253.8 KB · Views: 12
Upvote 0

aeric

Expert
Licensed User
Longtime User
Which desktop manager you are using? Gnome, KDE Plasma, XFCE?
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
Think there's a lack of information here, is it a virtual machine running in a window?
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
The java window (running in Linux) can only exist in that virtual machine window, it can't escape onto the host OS desktop, VM doesn't know it exists.
 
Upvote 0
Top