support for the MOTIF noBorder hint
svn path=/trunk/kdebase/kwin/; revision=45820
This commit is contained in:
parent
6a5046ebb6
commit
6d299fc9a4
4 changed files with 52 additions and 6 deletions
|
@ -38,6 +38,9 @@ Atoms::Atoms()
|
|||
atoms[n] = &kwm_command;
|
||||
names[n++] = (char *) "KWM_COMMAND";
|
||||
|
||||
atoms[n] = &motif_wm_hints;
|
||||
names[n++] = (char *) "_MOTIF_WM_HINTS";
|
||||
|
||||
atoms[n] = &net_number_of_desktops;
|
||||
names[n++] = (char *) "_NET_NUMBER_OF_DESKTOPS";
|
||||
|
||||
|
|
2
atoms.h
2
atoms.h
|
@ -19,6 +19,8 @@ public:
|
|||
Atom kwm_command; // compatibility
|
||||
Atom kwm_running;
|
||||
|
||||
Atom motif_wm_hints;
|
||||
|
||||
Atom net_number_of_desktops;
|
||||
Atom net_current_desktop;
|
||||
Atom net_active_window;
|
||||
|
|
|
@ -54,6 +54,38 @@ int Shape::shapeEvent()
|
|||
return kwin_shape_event;
|
||||
}
|
||||
|
||||
bool Motif::noBorder( WId w )
|
||||
{
|
||||
struct MwmHints {
|
||||
ulong flags;
|
||||
ulong functions;
|
||||
ulong decorations;
|
||||
long input_mode;
|
||||
ulong status;
|
||||
};
|
||||
Atom type;
|
||||
int format;
|
||||
unsigned long length, after;
|
||||
unsigned char* data;
|
||||
MwmHints* hints = 0;
|
||||
if ( XGetWindowProperty( qt_xdisplay(), w, atoms->motif_wm_hints, 0, 5,
|
||||
FALSE, atoms->motif_wm_hints, &type, &format,
|
||||
&length, &after, &data ) == Success ) {
|
||||
if ( data )
|
||||
hints = (MwmHints*) data;
|
||||
}
|
||||
bool result = FALSE;
|
||||
if ( hints ) {
|
||||
if ( hints->flags & (1L << 1 ) ) { // // MWM_HINTS_DECORATIONS;
|
||||
if ( hints->decorations == 0 )
|
||||
result = TRUE;
|
||||
}
|
||||
XFree( data );
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
Updates kwin_time by receiving a current timestamp from the server.
|
||||
|
@ -73,6 +105,10 @@ static void updateTime()
|
|||
|
||||
Client* Workspace::clientFactory( Workspace *ws, WId w )
|
||||
{
|
||||
if ( Motif::noBorder( w ) )
|
||||
return new NoBorderClient( ws, w );
|
||||
|
||||
|
||||
// hack TODO hints
|
||||
QString s = KWM::title( w );
|
||||
if ( s == "THE DESKTOP" ) {
|
||||
|
|
|
@ -67,6 +67,11 @@ public:
|
|||
static int shapeEvent();
|
||||
};
|
||||
|
||||
class Motif {
|
||||
public:
|
||||
static bool noBorder( WId w );
|
||||
};
|
||||
|
||||
class Workspace : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
Loading…
Reference in a new issue