Fix sequence

This commit is contained in:
Ximi1970
2020-04-09 21:59:22 +02:00
parent b422e364fe
commit 7f7afe9fd8
2 changed files with 29 additions and 8 deletions

View File

@@ -68,6 +68,11 @@ xprop
https://askubuntu.com/questions/646346/xfce-hiding-an-application-from-the-taskbar https://askubuntu.com/questions/646346/xfce-hiding-an-application-from-the-taskbar
wmctrl -i -r xxxx -b add,skip_taskbar
wmctrl -i -r xxxx -b remove,skip_taskbar
xprop -id xxxxx | grep "CLASS" xprop -id xxxxx | grep "CLASS"
wmctrl -x -r name.name -b add,skip_taskbar wmctrl -x -r name.name -b add,skip_taskbar

View File

@@ -491,31 +491,47 @@ QList< WindowCtrlUnix::WindowItem > WindowCtrlUnix::listXWindows( Display *dis
void WindowCtrlUnix::sendEvent( quint64 window, const char* msg, long action, void WindowCtrlUnix::sendEvent( quint64 window, const char* msg, long action,
long prop1, long prop2, long prop3, long prop4 ) long prop1, long prop2, long prop3, long prop4 )
{ {
Display* display = XOpenDisplay( nullptr );
Window win = static_cast<Window>( window ); Window win = static_cast<Window>( window );
Atom msg_atom = XInternAtom( display, msg, False );
if( msg_atom == None )
{
return;
}
Atom skip_atom = XInternAtom( display, "_NET_WM_STATE_SKIP_TASKBAR", False );
if( skip_atom == None )
{
return;
}
XEvent event; XEvent event;
event.xclient.type = ClientMessage; event.xclient.type = ClientMessage;
event.xclient.serial = 0; event.xclient.serial = 0;
event.xclient.send_event = True; event.xclient.send_event = True;
event.xclient.message_type = XInternAtom( m_display, msg, False ); event.xclient.message_type = msg_atom;
event.xclient.window = win; event.xclient.window = win;
event.xclient.format = 32; event.xclient.format = 32;
event.xclient.data.l[0] = action; event.xclient.data.l[0] = action;
event.xclient.data.l[1] = prop1; event.xclient.data.l[1] = static_cast<long>( skip_atom );
event.xclient.data.l[2] = prop2; event.xclient.data.l[2] = prop2;
event.xclient.data.l[2] = prop3; event.xclient.data.l[3] = prop3;
event.xclient.data.l[2] = prop4; event.xclient.data.l[4] = prop4;
if( XSendEvent( m_display, win, False, SubstructureRedirectMask | SubstructureNotifyMask, &event ) ) if( XSendEvent( display, DefaultRootWindow( display ), False, SubstructureRedirectMask | SubstructureNotifyMask, &event ) )
{ {
emit signalConsole( "Event sent" ); emit signalConsole( QString( "Event sent to: %1, %2, %3" ).arg( window ).arg( action ).arg( prop1 ) );
} }
else else
{ {
emit signalConsole( "Event NOT sent" ); emit signalConsole( QString( "Event NOT sent to: %1, %2, %3" ).arg( window ).arg( action ).arg( prop1 ) );
} }
XFlush( m_display ); XCloseDisplay( display );
} }