animated shading works again. Shortcut for shading possible

"Window shade"

svn path=/trunk/kdebase/kwin/; revision=35392
This commit is contained in:
Matthias Ettrich 1999-11-29 02:49:20 +00:00
parent ddaa516ba4
commit 91d73bedca
6 changed files with 24 additions and 17 deletions

2
README
View file

@ -10,7 +10,7 @@ Currently supported options in the kwinrc:
MoveMode=Opaque|Transparent
ResizeMode=Opaque|Transparent
Placement=Smart|Random|Cascade
AnimateShade=TRUE|FALSE
AnimateShade=true|false
AnimSteps=<integer=20>
BorderSnapZone=<integer=10>
WindowSnapZone=<integer=10>

View file

@ -1356,8 +1356,8 @@ void Client::setShade( bool s )
windowWrapper()->hide();
repaint( FALSE ); // force direct repaint
setWFlags( WNorthWestGravity );
int step = QMAX( 15, QABS( h - s.height() ) / as )+1;
do {
int step = QMAX( 4, QABS( h - s.height() ) / as )+1;
do {
h -= step;
resize ( s.width(), h );
QApplication::syncX();
@ -1368,8 +1368,8 @@ void Client::setShade( bool s )
int h = height();
QSize s( sizeForWindowSize( windowWrapper()->size(), TRUE ) );
setWFlags( WNorthWestGravity );
int step = QMAX( 15, QABS( h - s.height() ) / as )+1;
do {
int step = QMAX( 4, QABS( h - s.height() ) / as )+1;
do {
h += step;
resize ( s.width(), h );
// assume a border

View file

@ -14,3 +14,4 @@
keys->insertItem(i18n("Window maximize vertical"),"Window maximize vertical", "");
keys->insertItem(i18n("Window maximize horizontal"),"Window maximize horizontal", "");
keys->insertItem(i18n("Window iconify"),"Window iconify", "");
keys->insertItem(i18n("Window shade"),"Window shade", "");

View file

@ -13,12 +13,6 @@ Options::Options()
cg[i] = NULL;
reload();
//CT fix them for now. Will be read from rc
placement = Smart;
animate_shade = false;
anim_steps = 20;
border_snap_zone = window_snap_zone = 10;
connect( kapp, SIGNAL( appearanceChanged() ), this, SLOT(reload() ) );
}
@ -151,9 +145,9 @@ void Options::reload()
else if (val == "Random") placement = Random;
else if (val == "Cascade") placement = Cascade;
animate_shade = config->readBoolEntry("AnimateShade", false);
animate_shade = config->readBoolEntry("AnimateShade", TRUE );
anim_steps = config->readNumEntry("AnimSteps", 20);
anim_steps = config->readNumEntry("AnimSteps", 50);
border_snap_zone = config->readNumEntry("BorderSnapZone", 10);
window_snap_zone = config->readNumEntry("WindowSnapZone", 10);

View file

@ -26,7 +26,7 @@ extern Time kwin_time;
// Necessary since shaped window are an extension to X
static int kwin_has_shape = 0;
static int kwin_shape_event = 0;
static bool block_focus = FALSE;
// does the window w need a shape combine mask around it?
bool Shape::hasShape( WId w){
int xws, yws, xbs, ybs;
@ -835,7 +835,7 @@ void Workspace::clientHidden( Client* c )
focus_chain.remove( c );
focus_chain.prepend( c );
}
if ( options->focusPolicyIsReasonable() ) {
if ( !block_focus && options->focusPolicyIsReasonable() ) {
for ( ClientList::ConstIterator it = focus_chain.fromLast(); it != focus_chain.begin(); --it) {
if ( (*it)->isVisible() ) {
requestFocus( *it );
@ -1283,6 +1283,9 @@ void Workspace::setCurrentDesktop( int new_desktop ){
if (new_desktop == current_desktop || new_desktop < 1 || new_desktop > number_of_desktops )
return;
active_client = 0;
block_focus = TRUE;
/*
optimized Desktop switching: unmapping done from back to front
mapping done from front to back => less exposure events
@ -1307,7 +1310,8 @@ void Workspace::setCurrentDesktop( int new_desktop ){
PropModeReplace, (unsigned char *)&current_desktop, 1);
// try to restore the focus on this desktop
// restore the focus on this desktop
block_focus = FALSE;
Client* c = active_client?active_client:previousClient(0);
Client* stop = c;
while ( c && !c->isVisible() ) {
@ -1499,6 +1503,7 @@ void Workspace::createKeybindings(){
keys->connectItem( "Window maximize horizontal", this, SLOT( slotWindowMaximizeHorizontal() ) );
keys->connectItem( "Window maximize vertical", this, SLOT( slotWindowMaximizeVertical() ) );
keys->connectItem( "Window iconify", this, SLOT( slotWindowIconify() ) );
keys->connectItem( "Window shade", this, SLOT( slotWindowShade() ) );
keys->readSettings();
}
@ -1550,6 +1555,12 @@ void Workspace::slotWindowIconify()
popup_client->iconify();
}
void Workspace::slotWindowShade()
{
if ( popup_client )
popup_client->setShade( !popup_client->isShade() );
}
void Workspace::desktopPopupAboutToShow()
{
if ( !desk_popup )

View file

@ -119,6 +119,7 @@ public slots:
void slotWindowMaximizeVertical();
void slotWindowMaximizeHorizontal();
void slotWindowIconify();
void slotWindowShade();
void slotWindowOperations();
void slotWindowClose();
@ -177,7 +178,7 @@ private:
bool removeDockwin( WId w );
void propagateDockwins();
DockWindow findDockwin( WId w );
//CT needed for cascading+
struct CascadingInfo {
QPoint pos;