mirror of
https://github.com/KDE/konsole.git
synced 2025-12-23 23:38:08 -05:00
sessions reactivated
svn path=/trunk/kdebase/konsole/; revision=11854
This commit is contained in:
@@ -52,8 +52,9 @@ konsole_LDFLAGS = $(all_libraries) $(KDE_RPATH)
|
||||
|
||||
# the library search path.
|
||||
|
||||
# extra libraries for jpeg and png image formats; kfiledialog
|
||||
EXTRALIBS = $(LIB_KIMGIO)
|
||||
# i have had troubles with the @LIB_KIMGIO@ macro.
|
||||
# if you like to put it in here, please make sure it works before commiting
|
||||
EXTRALIBS = $(KIMGIO_LIBS) -lkimgio
|
||||
|
||||
# just to make sure, automake makes them
|
||||
BUILTSOURCES =TEWidget.moc TEmuVt102.moc session.moc main.moc TEmulation.moc TEShell.moc
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
#define MAX(a,b) ((a)>(b)?(a):(b))
|
||||
|
||||
#define HERE printf("%s(%d): here\n",__FILE__,__LINE__)
|
||||
#define HCNT(Name) //{ static int cnt = 1; printf("%s(%d): %s %d\n",__FILE__,__LINE__,Name,cnt++); }
|
||||
|
||||
#define loc(X,Y) ((Y)*columns+(X))
|
||||
|
||||
@@ -236,6 +237,7 @@ void TEWidget::setImage(const ca* const newimg, int lines, int columns)
|
||||
QPainter paint;
|
||||
setUpdatesEnabled(FALSE);
|
||||
paint.begin( this );
|
||||
HCNT("setImage");
|
||||
|
||||
QPoint tL = contentsRect().topLeft();
|
||||
int tLx = tL.x();
|
||||
@@ -307,6 +309,7 @@ void TEWidget::paintEvent( QPaintEvent* pe )
|
||||
setUpdatesEnabled(FALSE);
|
||||
paint.begin( this );
|
||||
paint.setBackgroundMode( TransparentMode );
|
||||
HCNT("paintEvent");
|
||||
|
||||
// Note that the actual widget size can be slightly larger
|
||||
// that the image (the size is truncated towards the smaller
|
||||
@@ -373,6 +376,7 @@ void TEWidget::resizeEvent(QResizeEvent* ev)
|
||||
//printf("approx: %d,%d\n",ev->size().width()/font_w,ev->size().height()/font_h);
|
||||
//printf("leaves: %d,%d\n",ev->size().width()%font_w,ev->size().height()%font_h);
|
||||
//printf("curren: %d,%d\n",width(),height());
|
||||
HCNT("resizeEvent");
|
||||
|
||||
// see comment in `paintEvent' concerning the rounding.
|
||||
//FIXME: could make a routine here; check width(),height()
|
||||
|
||||
21
src/main.C
21
src/main.C
@@ -99,11 +99,17 @@ TEDemo::TEDemo(char* args[]) : KTMainWindow()
|
||||
|
||||
addSession(new TESession(this,te,args,"xterm"),args[0]);
|
||||
se->setFontNo(n_font);
|
||||
setSchema(s_schema);
|
||||
setColLin(lincol.width(),lincol.height());
|
||||
}
|
||||
|
||||
/*!
|
||||
sets application window to a size
|
||||
based on columns X lines of the te
|
||||
guest widget
|
||||
*/
|
||||
|
||||
void TEDemo::setColLin(int columns, int lines)
|
||||
// set set application to a specific size
|
||||
{
|
||||
te->setFixedSize(te->calcSize(columns,lines));
|
||||
updateRects();
|
||||
@@ -229,8 +235,8 @@ void TEDemo::makeMenu()
|
||||
|
||||
//FIXME: deactivated mainly because it flickers like crasy
|
||||
// appears to do well otherwise
|
||||
//menubar->insertItem(i18n("New"), m_commands);
|
||||
//menubar->insertItem(i18n("Sessions"), m_sessions);
|
||||
menubar->insertItem(i18n("New"), m_commands);
|
||||
menubar->insertItem(i18n("Sessions"), m_sessions);
|
||||
|
||||
menubar->insertItem(i18n("Options"), m_options);
|
||||
menubar->insertSeparator();
|
||||
@@ -467,6 +473,15 @@ static QIntDict<TESession> no2session;
|
||||
static QPtrDict<void> session2no;
|
||||
static int session_no = 0;
|
||||
|
||||
//FIXME: activating sessions creates a lot flicker in the moment.
|
||||
// it comes from setting the attributes of a session individually.
|
||||
// ONE setImage call should actually be enough to match all cases.
|
||||
// These can be quite different:
|
||||
// - The screen size might have changed while the session was
|
||||
// detached. A propagation of the resize should in this case
|
||||
// make the drawEvent.
|
||||
// - font, background image and color palette should be set in one go.
|
||||
|
||||
void TEDemo::activateSession(int sn)
|
||||
{
|
||||
TESession* s = no2session.find(sn);
|
||||
|
||||
Reference in New Issue
Block a user