KSnapshot: remember window position before/after a snapshot is taken. This resolves issue #55

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/56/head
Michele Calgaro 1 year ago
parent 5eeaa69b25
commit 69768c94ed
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -162,6 +162,8 @@ KSnapshot::KSnapshot(TQWidget *parent, const char *name, bool grabCurrent)
connect( this, TQT_SIGNAL( user1Clicked() ), TQT_SLOT( reject() ) ); connect( this, TQT_SIGNAL( user1Clicked() ), TQT_SLOT( reject() ) );
mainWidget->btnNew->setFocus(); mainWidget->btnNew->setFocus();
oldWinPos = pos();
} }
KSnapshot::~KSnapshot() KSnapshot::~KSnapshot()
@ -277,6 +279,7 @@ void KSnapshot::slotDragSnapshot()
void KSnapshot::slotGrab() void KSnapshot::slotGrab()
{ {
oldWinPos = pos();
hide(); hide();
if ( mainWidget->delay() && mainWidget->mode() != Region ) if ( mainWidget->delay() && mainWidget->mode() != Region )
@ -365,6 +368,7 @@ void KSnapshot::slotRegionGrabbed( const TQPixmap &pix )
delete rgnGrab; delete rgnGrab;
TQApplication::restoreOverrideCursor(); TQApplication::restoreOverrideCursor();
move(oldWinPos);
show(); show();
} }
@ -379,6 +383,7 @@ void KSnapshot::slotWindowGrabbed( const TQPixmap &pix )
} }
TQApplication::restoreOverrideCursor(); TQApplication::restoreOverrideCursor();
move(oldWinPos);
show(); show();
} }
@ -560,6 +565,7 @@ void KSnapshot::performGrab()
TQApplication::restoreOverrideCursor(); TQApplication::restoreOverrideCursor();
modified = true; modified = true;
updateCaption(); updateCaption();
move(oldWinPos);
show(); show();
} }

@ -153,6 +153,7 @@ private:
bool modified; bool modified;
TDETrader::OfferList openWithOffers; TDETrader::OfferList openWithOffers;
TQMap<TDEProcess*, KTempFile*> m_tmpFiles; TQMap<TDEProcess*, KTempFile*> m_tmpFiles;
TQPoint oldWinPos;
}; };
#endif // KSNAPSHOT_H #endif // KSNAPSHOT_H

Loading…
Cancel
Save