mIRC Home    About    Download    Register    News    Help

Print Thread
/window can't move/resize maximized window #269579 07/11/21 11:05 AM
Joined: Jul 2006
Posts: 3,829
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,829
If a custom window is maximized, /window cannot move the window or resize it around, is this intended? I would expect it to be able to move without problem, in my case I don't want to change the size, only move the window from its location, while keeping its size, executing /window -r first is not really an option for me.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: /window can't move/resize maximized window [Re: Wims] #269580 07/11/21 08:35 PM
Joined: Jan 2012
Posts: 180
Epic Offline
Vogon poet
Offline
Vogon poet
Joined: Jan 2012
Posts: 180
If I understand correctly what you want to do, then I can suggest that you try a workaround to solve this problem.
You can use the stretched window in "normal" state to fit your screen size. It will be similar to what it looks like in "maximized" state, and you will be able to move such a window.

To run and view the demo script, enter the command "/winmove":
Code
alias winmove {
  .window -d @WINMOVE 0 0 $window(@desktop).w $window(@desktop).h
  .echo -s @WINMOVE state:04 $window(@WINMOVE).state
  .timerWM1 -m 1 2000 .window @WINMOVE 50 50 -1 -1
  .timerWM2 -m 1 3000 .window @WINMOVE -50 100 -1 -1
  .timerWM3 -m 1 4000 .window @WINMOVE 50 150 -1 -1
  .timerWM4 -m 1 5000 .window @WINMOVE -50 200 -1 -1
  .timerWM5 -m 1 6000 .window @WINMOVE 0 250 -1 -1
  .timerWM6 -m 1 7000 .window @WINMOVE 0 0 $window(@desktop).w $window(@desktop).h
  .timerWM7 -m 1 10000 .window -c @WINMOVE
}

I assume that the window that is open in "maximized" state can't and shouldn't move, because it is glued (fixed) by the system itself to the borders of the screen. I could be wrong.


πŸ…ΈπŸ†πŸ…² - 𝔦'𝔱𝔰 𝔸 π•‚π–ŽΙ΄π™™ ᴏ𝙛 π•„π™–π–Œπ™žπ™˜
Re: /window can't move/resize maximized window [Re: Epic] #269581 07/11/21 09:07 PM
Joined: Jul 2006
Posts: 3,829
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,829
No you are right, maximized windows have smaller borders, smaller titlebar and cannot be moved.

I already tried to workaround the problem by storing the position and size while it's maximized, unmaximizing the window with window -r and then applying the stored size & position with /window again, the problem is that with the difference in size for the borders and titlebar is creating a gap where the window is not taking the whole screen, and the size of borders etc will vary between version of windows, you can't control this with mirc scripting alone.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: /window can't move/resize maximized window [Re: Wims] #269584 08/11/21 07:55 PM
Joined: Jan 2012
Posts: 180
Epic Offline
Vogon poet
Offline
Vogon poet
Joined: Jan 2012
Posts: 180
As far as I understand you do not like that with this method of stretching the window, its borders remain visible.
But I managed to hide them as much as possible by using the second command to resize and position the window. In my case, in the system "Windows 8.1", this is very similar to the "maximized" state.

Try this way:
Code
alias winmove {
  .window -d @WINMOVE 0 0 $window(@desktop).w $window(@desktop).h
  .window @WINMOVE -8 -5 $calc($window(@desktop).w +16) $calc($window(@desktop).h -27)
  .timerWM -m 1 10000 .window -c @WINMOVE
}

Or using a no borders window:
Code
//window -d +d @WINMOVE 0 0 $window(@desktop).w $window(@desktop).h

Most likely, apart from these methods, there is nothing else that could affect and change this position of the window borders. Unless only Khaled comes up with some new switch for windows for us.


πŸ…ΈπŸ†πŸ…² - 𝔦'𝔱𝔰 𝔸 π•‚π–ŽΙ΄π™™ ᴏ𝙛 π•„π™–π–Œπ™žπ™˜
Re: /window can't move/resize maximized window [Re: Wims] #269586 10/11/21 09:43 AM
Joined: Dec 2002
Posts: 5,020
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,020
The maximize state is a specific windows flag. When a window is maximized, it is treated differently by Windows. So, no, you cannot treat a maximized window in the same way as a normal, restored window.