some bugfixes

svn path=/trunk/kdebase/kwin/; revision=60295
This commit is contained in:
Matthias Ettrich 2000-08-09 10:02:56 +00:00
parent 5d85790c91
commit ffbe75dfba
4 changed files with 67 additions and 58 deletions

View file

@ -421,6 +421,7 @@ Client::Client( Workspace *ws, WId w, QWidget *parent, const char *name, WFlags
is_sticky = FALSE;
stays_on_top = FALSE;
may_move = TRUE;
skip_taskbar = FALSE;
getWMHints();
getWindowProtocols();
@ -439,6 +440,9 @@ Client::Client( Workspace *ws, WId w, QWidget *parent, const char *name, WFlags
// window wants to stay on top?
stays_on_top = ( info->state() & NET::StaysOnTop) != 0 || transient_for == workspace()->rootWin();
// window does not want a taskbar entry?
skip_taskbar = ( info->state() & NET::SkipTaskbar) != 0;
// should we open this window on a certain desktop?
if ( info->desktop() == NETWinInfo::OnAllDesktops )
@ -488,7 +492,6 @@ bool Client::manage( bool isMapped, bool doNotShow )
may_move = FALSE; // don't let fullscreen windows be moved around
} else {
if ( (xSizeHint.flags & PPosition) || (xSizeHint.flags & USPosition) ) {
if ( (xSizeHint.flags & USPosition) == 0 ) {
QRect area = workspace()->clientArea();
if ( !area.contains( geom.topLeft() ) ) {
int tx = geom.x();
@ -499,7 +502,6 @@ bool Client::manage( bool isMapped, bool doNotShow )
ty = area.y();
geom.moveTopLeft( QPoint( tx, ty ) );
}
}
placementDone = TRUE;
}
if ( (xSizeHint.flags & USSize) || (xSizeHint.flags & PSize) ) {
@ -1456,7 +1458,7 @@ void Client::iconify()
Events::raise( Events::Iconify );
setMappingState( IconicState );
if ( !isTransient() )
if ( !isTransient() && isVisible() )
animateIconifyOrDeiconify( TRUE );
hide();
@ -2257,7 +2259,7 @@ NET::WindowType Client::windowType() const
bool Client::wantsTabFocus() const
{
return windowType() == NET::Normal && ( input || Ptakefocus );
return windowType() == NET::Normal && ( input || Ptakefocus ) && !skip_taskbar;
}
/*!

View file

@ -252,6 +252,7 @@ private:
uint stays_on_top : 1;
uint is_shape :1;
uint may_move :1;
uint skip_taskbar :1;
uint Pdeletewindow :1; // does the window understand the DeleteWindow protocol?
uint Ptakefocus :1;// does the window understand the TakeFocus protocol?
uint Pcontexthelp : 1; // does the window understand the ContextHelp protocol?

View file

@ -28,8 +28,7 @@ void KillWindow::start() {
PointerMotionMask |
EnterWindowMask | LeaveWindowMask,
GrabModeAsync, GrabModeAsync, None,
kill_cursor, CurrentTime) == GrabSuccess)
{
kill_cursor, CurrentTime) == GrabSuccess) {
XGrabKeyboard(qt_xdisplay(), qt_xrootwin(), False,
GrabModeAsync, GrabModeAsync, CurrentTime);
@ -40,13 +39,11 @@ void KillWindow::start() {
XGrabServer(qt_xdisplay());
while (!return_pressed && !escape_pressed && !button_released)
{
while (!return_pressed && !escape_pressed && !button_released) {
XMaskEvent(qt_xdisplay(), KeyPressMask | ButtonPressMask |
ButtonReleaseMask | PointerMotionMask, &ev);
if (ev.type == KeyPress)
{
if (ev.type == KeyPress) {
int kc = XKeycodeToKeysym(qt_xdisplay(), ev.xkey.keycode, 0);
int mx = 0;
int my = 0;
@ -56,17 +53,19 @@ void KillWindow::start() {
if (kc == XK_Right) mx = 10;
if (kc == XK_Up) my = -10;
if (kc == XK_Down) my = 10;
if (ev.xkey.state & ControlMask)
{
if (ev.xkey.state & ControlMask) {
mx /= 10;
my /= 10;
}
QCursor::setPos(QCursor::pos()+QPoint(mx, my));
}
if (ev.type == ButtonRelease)
{
if (ev.type == ButtonRelease) {
button_released = (ev.xbutton.button == Button1);
if ( ev.xbutton.button == Button3 ) {
escape_pressed = TRUE;
break;
}
workspace->killWindowAtPosition(ev.xbutton.x_root, ev.xbutton.y_root);
}
continue;

View file

@ -1581,9 +1581,6 @@ void Workspace::raiseClient( Client* c )
if ( !c )
return;
if ( tab_box->isVisible() )
return;
ClientList saveset;
if ( c == desktop_client ) {
@ -1629,6 +1626,9 @@ void Workspace::raiseClient( Client* c )
propagateClients( TRUE );
if ( tab_box->isVisible() )
tab_box->raise();
}
@ -2073,6 +2073,13 @@ void Workspace::slotWindowLower()
*/
void Workspace::slotMouseEmulation()
{
if ( mouse_emulation ) {
XUngrabKeyboard(qt_xdisplay(), kwin_time);
mouse_emulation = FALSE;
return;
}
if ( XGrabKeyboard(qt_xdisplay(),
root, FALSE,
GrabModeAsync, GrabModeAsync,