fixed a minor focus problem

svn path=/trunk/kdebase/kwin/; revision=36074
This commit is contained in:
Matthias Ettrich 1999-12-07 21:54:52 +00:00
parent 126bc26fda
commit 9764a4f487
2 changed files with 12 additions and 13 deletions

View file

@ -258,7 +258,7 @@ StdClient::StdClient( Workspace *ws, WId w, QWidget *parent, const char *name )
button[6]->setIconSet( *question_mark_pix ); button[6]->setIconSet( *question_mark_pix );
connect( button[6], SIGNAL( clicked() ), this, ( SLOT( contextHelp() ) ) ); connect( button[6], SIGNAL( clicked() ), this, ( SLOT( contextHelp() ) ) );
} }
hb->addWidget( button[3] ); hb->addWidget( button[3] );
hb->addWidget( button[4] ); hb->addWidget( button[4] );
hb->addWidget( button[5] ); hb->addWidget( button[5] );
@ -294,8 +294,8 @@ StdClient::StdClient( Workspace *ws, WId w, QWidget *parent, const char *name )
if ( button[6] ) { if ( button[6] ) {
} }
if ( isTransient() ) { if ( isTransient() ) {
// lighter decoration for transient windows // lighter decoration for transient windows
button[1]->hide(); button[1]->hide();
@ -384,7 +384,7 @@ void StdClient::paintEvent( QPaintEvent* )
t.setRight( t.right() - 2 ); t.setRight( t.right() - 2 );
p.setPen(options->color(Options::Font, isActive())); p.setPen(options->color(Options::Font, isActive()));
p.setFont(options->font(isActive())); p.setFont(options->font(isActive()));
p.drawText( t, AlignLeft|AlignVCenter, caption() ); p.drawText( t, AlignLeft|AlignVCenter|SingleLine, caption() );
} }

View file

@ -245,7 +245,7 @@ bool Workspace::workspaceEvent( XEvent * e )
mouse_emulation = FALSE; mouse_emulation = FALSE;
XUngrabKeyboard( qt_xdisplay(), kwin_time ); XUngrabKeyboard( qt_xdisplay(), kwin_time );
} }
Client * c = findClient( e->xany.window ); Client * c = findClient( e->xany.window );
if ( c ) if ( c )
return c->windowEvent( e ); return c->windowEvent( e );
@ -853,12 +853,11 @@ void Workspace::requestFocus( Client* c)
if ( !popup || !popup->isVisible() ) if ( !popup || !popup->isVisible() )
popup_client = c; popup_client = c;
active_client = c;
if ( c->isVisible() && !c->isShade() ) { if ( c->isVisible() && !c->isShade() ) {
c->takeFocus(); c->takeFocus();
should_get_focus = c; should_get_focus = c;
setActiveClient( c );
} else if ( c->isShade() ) { } else if ( c->isShade() ) {
// client cannot accept focus, but at least the window should be active (window menu, et. al. ) // client cannot accept focus, but at least the window should be active (window menu, et. al. )
focusToNull(); focusToNull();
@ -1731,7 +1730,7 @@ void Workspace::desktopPopupAboutToShow()
/*! /*!
The client popup menu will become visible soon. The client popup menu will become visible soon.
Adjust the items according to the respective popup client. Adjust the items according to the respective popup client.
*/ */
void Workspace::clientPopupAboutToShow() void Workspace::clientPopupAboutToShow()
@ -1916,7 +1915,7 @@ QPoint Workspace::adjustClientPosition( Client* c, QPoint pos )
} }
/*! /*!
Handles keypress event during mouse emulation Handles keypress event during mouse emulation
*/ */
bool Workspace::keyPressMouseEmulation( XKeyEvent key ) bool Workspace::keyPressMouseEmulation( XKeyEvent key )
@ -1925,12 +1924,12 @@ bool Workspace::keyPressMouseEmulation( XKeyEvent key )
return FALSE; return FALSE;
int kc = XKeycodeToKeysym(qt_xdisplay(), key.keycode, 0); int kc = XKeycodeToKeysym(qt_xdisplay(), key.keycode, 0);
int km = key.state & (ControlMask | Mod1Mask | ShiftMask); int km = key.state & (ControlMask | Mod1Mask | ShiftMask);
bool is_control = km & ControlMask; bool is_control = km & ControlMask;
bool is_alt = km & Mod1Mask; bool is_alt = km & Mod1Mask;
int delta = is_control?1:is_alt?32:8; int delta = is_control?1:is_alt?32:8;
QPoint pos = QCursor::pos(); QPoint pos = QCursor::pos();
switch ( kc ) { switch ( kc ) {
case XK_Left: case XK_Left:
case XK_KP_Left: case XK_KP_Left:
@ -1959,7 +1958,7 @@ bool Workspace::keyPressMouseEmulation( XKeyEvent key )
uint state; uint state;
Window w; Window w;
Client * c = 0; Client * c = 0;
do { do {
w = child; w = child;
if (!c) if (!c)
c = findClientWidthId( w ); c = findClientWidthId( w );
@ -1998,7 +1997,7 @@ bool Workspace::keyPressMouseEmulation( XKeyEvent key )
default: default:
return FALSE; return FALSE;
} }
QCursor::setPos( pos ); QCursor::setPos( pos );
return TRUE; return TRUE;