user-none / KDocker

Dock most applications to the system tray
GNU General Public License v2.0
298 stars 22 forks source link

Maximized by Default? #126

Open ndmax opened 4 months ago

ndmax commented 4 months ago

Lubuntu user here (23.04). I know KDocker wasn't designed for LQXt, but I've been using it extensively for a year or so. Generally speaking, iKDocker works brilliantly in Lubuntu and has become a workflow-essential for me. I'm grateful for those who have contributed to this project.

For any docked app, whenever its window is not maximized, KDocker seems to remember the window size when restored/shown. If, however, I maximize the app window and then hide to dock, the next time I restore/show the app, its window size is reset to a very small default (and positioned in the top left corner).

I've just been manually sizing app windows to fill most of the available screen space. It works fine, but I'd like to be able to set all application windows by default to either be maximized or hidden to dock.

Is that possible, and if so, how?

Daxx commented 4 months ago

I don't think KDocker is causing your problem. On KDE, KWin restores a maximized window correctly for KDocker. All KDocker is doing is UNMAP and MAP to HIDE and SHOW the window.

Try taking KDocker out of the equation and just use xdotool* to see if your window manager handles it any differently.

[Start any one of your apps and maximize its window, then in console] xdotool selectwindow windowunmap sleep 1 windowmap windowactivate [When the mouse pointer changes to an eye, click on your maximized app's window]

If it comes back small, that proves it's not KDocker. If it comes back maximized, further head-scratching might be necessary.

*(xdotool might need to be installed from your repo)

ndmax commented 4 months ago

Thanks, @Daxx, for your helpful suggestion.

I used this test method on a few different apps: VS Code, FeatherPad, KCalc and Office 365 (Chrome Web App). The results were the same in each case:

  1. Start app
  2. Run xdotool selectwindow windowunmap sleep 1 windowmap windowactivate in console and select ("eye-click") app.
  3. App minimizes with console error: XGetWindowProperty[_NET_WM_DESKTOP] failed (code=1)
  4. Minimized app is unresponsive (i.e. will not restore) for about 3 seconds.
  5. Minimized app restores fully maximized

I'm going to have to do a little more digging on UNMAP/MAP/HIDE/SHOW in LQXt and what the error message means. Thanks in advance for any comments or insights anyone may be able to provide.

Daxx commented 4 months ago

I got that error message and ignored it. Sorry, forgot to mention.

Interesting that it restored maximized though -- so it is different from KDocker, hmmm.

ndmax commented 4 months ago

I forgot to note that it did not restore programmatically (windowmap windowactivate). After the app was unresponsive (in the task bar) I had to manually click restore - and it came back maximized.

Daxx commented 4 months ago

Ah, okay, thanks. I tried with KCalc -- it doesn't maximize very well. FeatherPad looks good (although I don't have it). So that I can make a useful command, can you show the output from: wmctrl -l | grep "FeatherPad" If there's no output, change the grep to whatever wmctrl -l shows that looks like the FeatherPad window ;) (or just cheat and copy the relevant line)

Also, please show your output from: wmctrl -m and kdocker -v

ndmax commented 4 months ago

Thanks, @Daxx, for your reply. Here's the output from those commands.

wmctrl -l | grep "Untitled" // 0x06e00006 0 PBA166 "Untitled"

wmctrl -m

Name: Openbox
Class: 
PID: N/A
Window manager's "showing the desktop" mode: OFF

kdocker -v

KDocker version: 5.4
Using Qt version: 5.15.8

This web-apps example shows how I'm typically starting and docking applications:

bash -c "google-chrome  --profile-directory=Default --app-id=${apps[$1]} &"
while  true; do
  sleep 1
  status=$(wmctrl -l | grep "${titles[$1]}")
  if [ "$status" != "" ] ; then break; fi
done
WID="$(wmctrl -lx | grep "${titles[$1]}")";
kdocker -qw "${WID%% *}" -i "${icons[$1]}"
Daxx commented 4 months ago

Running Lubuntu 23.10 under VirtualBox VM with thanks to https://www.osboxes.org/lubuntu/

Using xdotool only, I can't get a FeatherPad window to map back programmatically regardless of whether it's maximized or normal.

I might try changing the window manager from 'openbox' to 'i3' for curiosity but it doesn't seem to be related to KDocker at all.

ndmax commented 3 months ago

Okay thanks @Daxx for checking into it - I'll continue to investigate and see if I can track down the culprit.

Massimo-B commented 1 month ago

KDocker starting a chrome browser on Xfce. Hiding and unhiding usually remembers the last window size. But initially, when starting KDocker with chrome it always only fills half of the screen. How can I make it fullscreen initially?

Daxx commented 1 month ago

How can I make it fullscreen initially?

https://www.tldevtech.com/how-to-start-google-chrome-with-maximized-window/

https://docs.xfce.org/xfce/xfwm4/faq#is_it_possible_to_have_windows_remember_their_position