Help to move outside window - Gnome

Linux specific forum
User avatar
holzhacker
Enthusiast
Enthusiast
Posts: 125
Joined: Mon Mar 08, 2010 9:14 pm
Location: "Mens sana in corpore sano"
Contact:

Help to move outside window - Gnome

Post by holzhacker »

Friends,

Anyone out there know how I can move an external window in Linux Desktop to another (another monitor)?

I believe in the API have something, but I'm not finding anything.

I need to move the PureBasic Debugger window to another desktop to slightly improve the working environment

I would appreciate any help.
Greetings and thanks!

Romerio Medeiros
romerio@gmail.com
Oma
Enthusiast
Enthusiast
Posts: 312
Joined: Thu Jun 26, 2014 9:17 am
Location: Germany

Re: Help to move outside window - Gnome

Post by Oma »

Hello Romerio,
i don't know a way to do this with gtk or gdk on external windows - what doen't mean there isn't one. But Linux is very strict in such things.

But maybe you can use 'wmctrl' for your needs. It controls the most important windows managers.
If you don't have it installed, use i.e. 'sudo apt-get install wmctrl'.
You can use it from terminal or from PureBasic with RunProgram().

And now i'm not sure what you really want? :?:
If you want to move the PB Debugwindow to another Desktop No, here's an example which you should modify for your need.

Code: Select all

;this needs 'wmctrl' !!!
Debug "";                                         opens the PB-Debugger-Window for demonstration

Global.i gProgrammId
Global.i gToDesk    = 0;                          desired desktop number - numbers starts from '0'
;Global.s gWinTitle  = "Debugger-Ausgabe";         german, full title not required! PB-Debugger title depends on language
Global.s gWinTitle  = "Debug Output";             english,  "

;Delay(500)
; '-r' specifies a window by the title
; '-t' moves specified window to desktop no x
gProgrammId= RunProgram("wmctrl", "-r " + #DQUOTE$ + gWinTitle + #DQUOTE$ + " -t " + Str(gToDesk) , "", #PB_Program_Hide)
I can't test an adaption to move the window to another monitor, but it could work like this:

Code: Select all

;this needs 'wmctrl' too!!!
;replace the 'MainMonitorWidth' within the RunProgramm-command with your main (left) monitor width, i.e. 1920, or more ...
;so the window should shift to the right monitor. If not, i can't help.
gProgrammId= RunProgram("wmctrl", "-r " + #DQUOTE$ + gWinTitle + #DQUOTE$ + " -e 0,MainMonitorWidth,-1,-1,-1", "", #PB_Program_Hide)
For more infos see http://linux.die.net/man/1/wmctrl

So, maybe it will help you
Regards, Charly
PureBasic 5.4-5.7, Linux: (X/L/K)Ubuntus+Mint - Windows XP (32Bit)
PureBasic Linux-API-Library & Viewer: http://www.chabba.de
User avatar
holzhacker
Enthusiast
Enthusiast
Posts: 125
Joined: Mon Mar 08, 2010 9:14 pm
Location: "Mens sana in corpore sano"
Contact:

Re: Help to move outside window - Gnome

Post by holzhacker »

Thank you Oma, :D

Solved the problem, I will make a tool for IDE that will automatically move the Debugger window to another monitor, I'll do it for windows also make available ... and soon it may be also useful for someone.

I was moving the windows to monitors every running ... and this is very annoying.
Below as I work ... now I'm going to automate.

Image
Greetings and thanks!

Romerio Medeiros
romerio@gmail.com
Post Reply