plasma-applet-active-window-control icon indicating copy to clipboard operation
plasma-applet-active-window-control copied to clipboard

Control window with only the current display

Open chipx opened this issue 9 years ago • 17 comments
trafficstars

If you connect 2 or more monitors, you can not manage a window on each individually. Can I do this? By analogy with the Icon-only task manager

chipx avatar Dec 17 '15 11:12 chipx

Do you mean:https://github.com/kotelnik/plasma-applet-active-window-control/issues/8 ?

Psi57 avatar Dec 17 '15 12:12 Psi57

No. I mean that the widget controls only the active window. I have 2 monitors and each has this widget. If I activate a window in one monitor, the management of this box will be available in both widgets.I want that widget managing windows only on the monitor where it is. If the active window is on another monitor, the widget should control the last active window on his monitor.

chipx avatar Dec 17 '15 13:12 chipx

1 On the monitors opened different windows, and both the widget controls only active

chipx avatar Dec 17 '15 13:12 chipx

Hi! If this is not supported in icon-only task manager, it is probably not possible to do that with my widget. But I'll do some research and get back to you.

kotelnik avatar Dec 22 '15 10:12 kotelnik

As I'm thinking about it. The widget only shows active window. Active window is always only one for the whole X11 session if I'm not mistaken. So it will most probably not be possible to show different active windows on each monitor.

kotelnik avatar Dec 22 '15 10:12 kotelnik

How then task manager filters the windows for monitors? His settings have a different options for filtering windows:

  • Only show tasks from the current screen
  • Only show tasks from the current desktop
  • etc...

chipx avatar Dec 22 '15 11:12 chipx

You're right. I'll try to look into it. Apparently there is the information about the screen. Hopefully there is also information about order of the existing windows so I can show the most top window as "active".

kotelnik avatar Dec 22 '15 11:12 kotelnik

It is good that we understand each other!

chipx avatar Dec 22 '15 15:12 chipx

Hi, this is a really nice applet, and I also hope that it can have this function, that only controls the windows on the current monitor.

If it is hard to implement, maybe we can add an option of "Do not show buttons if the active window is on the other monitor", to prevent users close wrong windows by mistake.

dontpanic92 avatar Jun 21 '16 08:06 dontpanic92

Hi, thanks for the really nice Plasmoid this function would really be nice for multi monitors

domacs avatar Apr 25 '17 08:04 domacs

Since nothing really changes here. @kotelnik Did you consider the solution proposed by @dontpanic92?

This would simply give the user the opportunity to set the widget to display either controls of the active window if both the window's and widget's displays are the same. Display what's set in No window text otherwise.

If you don't feel like you could do it yourself, maybe ask the community for help. There are some guys that are deep into panels, widgets and windows. @psifidotos: Maybe you could join in and help?

slagiewka avatar May 09 '17 17:05 slagiewka

@slagiewka it can be done but it isnt as simple ... The plasmoid should remember a per screen active window... That means that it should know in which screen each window belongs and to know also which screens are shown. So this isnt as simple as it sounds...

psifidotos avatar May 09 '17 18:05 psifidotos

@slagiewka one way that I thought is the easier to do in to use the libtaskmanager qml model that we use in Latte... doing so by setting to the model to filter windows per screen the Active Window Control will always know that the active window provided by the model is the one in the same screen with Active Window plasmoid... this would also make Active Window Control wayland ready...

psifidotos avatar May 09 '17 18:05 psifidotos

Sorry, I was busy with other things and left this for later. I've just committed a first iteration: option for showing "no window text" (and no control buttons) when active task is not on plasmoid's screen.

I can see 2 more levels that could be implemented:

  1. Show active window info, just hide the buttons (this is actually not that easy)
  2. Show top (=historically last active) window info on screen with no active window.

Both are doable. First using 2 TasksModels models (one with filterByScreen=true and one with filterByScreen=false). Second by remembering history of active tasks, not pretty... Maybe more elegant solution would be to write it as C++ plugin, like AppMenu is. Can you see some other approaches?

kotelnik avatar May 09 '17 21:05 kotelnik

Both are doable. First using 2 TasksModels models (one with filterByScreen=true and one with filterByScreen=false). Second by remembering history of active tasks, not pretty... Maybe more elegant solution would be to write it as C++ plugin, like AppMenu is. Can you see some other approaches?

another solution would be to use just one TasksModel and add in qml for example: property int lastActiveWindowId: -1

the TasksModel then can be set to filterByScreen=true. Afterwards we can update the lastActiveWindowId only when the activeWindow of the model is changed and it is valid... Then the activeWindow could be provided based only on the lastActiveWindowId

psifidotos avatar May 10 '17 14:05 psifidotos

Thanks by the implementation. It was necessary. Many windows closed by mistake.

vmorenomarin avatar May 26 '17 20:05 vmorenomarin

In Latte lately we support "Show panel background only for maximized window". So we needed to identify if there is any maximized window in the current screen. The code for the model to do this can be seen at,

https://github.com/psifidotos/Latte-Dock/blob/master/containment/package/contents/ui/WindowsModel.qml

psifidotos avatar May 26 '17 20:05 psifidotos