Reimplement Xinerama placement. Patch from Balaji Ramani.
CCMAIL: balaji@yablibli.com svn path=/trunk/kdebase/kwin/; revision=268719
This commit is contained in:
parent
528b0ed6d7
commit
875fc62836
5 changed files with 7 additions and 7 deletions
2
client.h
2
client.h
|
@ -80,7 +80,7 @@ class Client : public QObject, public KDecorationDefines
|
||||||
void windowEvent( XEvent* e );
|
void windowEvent( XEvent* e );
|
||||||
virtual bool eventFilter( QObject* o, QEvent* e );
|
virtual bool eventFilter( QObject* o, QEvent* e );
|
||||||
|
|
||||||
bool manage( Window w, bool isMapped );
|
bool manage( Window w, bool isMapped, bool useCursorPos );
|
||||||
|
|
||||||
void releaseWindow( bool on_shutdown = false );
|
void releaseWindow( bool on_shutdown = false );
|
||||||
|
|
||||||
|
|
|
@ -317,7 +317,7 @@ bool Workspace::workspaceEvent( XEvent * e )
|
||||||
// if ( e->xmaprequest.parent == root ) { //###TODO store previously destroyed client ids
|
// if ( e->xmaprequest.parent == root ) { //###TODO store previously destroyed client ids
|
||||||
if ( addSystemTrayWin( e->xmaprequest.window ) )
|
if ( addSystemTrayWin( e->xmaprequest.window ) )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
c = createClient( e->xmaprequest.window, false );
|
c = createClient( e->xmaprequest.window, false, true );
|
||||||
if ( c != NULL && root != qt_xrootwin() )
|
if ( c != NULL && root != qt_xrootwin() )
|
||||||
{ // TODO what is this?
|
{ // TODO what is this?
|
||||||
// TODO may use QWidget:.create
|
// TODO may use QWidget:.create
|
||||||
|
|
|
@ -33,7 +33,7 @@ namespace KWinInternal
|
||||||
reparenting, initial geometry, initial state, placement, etc.
|
reparenting, initial geometry, initial state, placement, etc.
|
||||||
Returns false if KWin is not going to manage this window.
|
Returns false if KWin is not going to manage this window.
|
||||||
*/
|
*/
|
||||||
bool Client::manage( Window w, bool isMapped )
|
bool Client::manage( Window w, bool isMapped, bool useCursorPos )
|
||||||
{
|
{
|
||||||
XWindowAttributes attr;
|
XWindowAttributes attr;
|
||||||
if( !XGetWindowAttributes(qt_xdisplay(), w, &attr))
|
if( !XGetWindowAttributes(qt_xdisplay(), w, &attr))
|
||||||
|
@ -181,7 +181,7 @@ bool Client::manage( Window w, bool isMapped )
|
||||||
if ( session )
|
if ( session )
|
||||||
geom = session->geometry;
|
geom = session->geometry;
|
||||||
|
|
||||||
QRect area = workspace()->clientArea( PlacementArea, geom.center(), desktop());
|
QRect area = workspace()->clientArea( PlacementArea, useCursorPos ? QCursor::pos() : geom.center(), desktop());
|
||||||
|
|
||||||
// if it's noborder window, and has size of one screen or the whole desktop geometry, it's fullscreen hack
|
// if it's noborder window, and has size of one screen or the whole desktop geometry, it's fullscreen hack
|
||||||
if( ( geom.size() == workspace()->clientArea( FullArea, geom.center(), desktop()).size()
|
if( ( geom.size() == workspace()->clientArea( FullArea, geom.center(), desktop()).size()
|
||||||
|
|
|
@ -403,11 +403,11 @@ Workspace::~Workspace()
|
||||||
_self = 0;
|
_self = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Client* Workspace::createClient( Window w, bool is_mapped )
|
Client* Workspace::createClient( Window w, bool is_mapped, bool use_cursor_pos )
|
||||||
{
|
{
|
||||||
StackingUpdatesBlocker blocker( this );
|
StackingUpdatesBlocker blocker( this );
|
||||||
Client* c = new Client( this );
|
Client* c = new Client( this );
|
||||||
if( !c->manage( w, is_mapped ))
|
if( !c->manage( w, is_mapped, use_cursor_pos ))
|
||||||
{
|
{
|
||||||
Client::deleteClient( c, Allowed );
|
Client::deleteClient( c, Allowed );
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -346,7 +346,7 @@ class Workspace : public QObject, public KWinInterface, public KDecorationDefine
|
||||||
void updateToolWindows( bool also_hide );
|
void updateToolWindows( bool also_hide );
|
||||||
|
|
||||||
// this is the right way to create a new client
|
// this is the right way to create a new client
|
||||||
Client* createClient( Window w, bool is_mapped );
|
Client* createClient( Window w, bool is_mapped, bool use_cursor_pos = false );
|
||||||
void addClient( Client* c, allowed_t );
|
void addClient( Client* c, allowed_t );
|
||||||
|
|
||||||
Window findSpecialEventWindow( XEvent* e );
|
Window findSpecialEventWindow( XEvent* e );
|
||||||
|
|
Loading…
Reference in a new issue