By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release. View | Details | Raw Unified | Return to bug 3164
Collapse All | Expand All

(-)tdebase-trinity-14.0.13_/kdesktop/bgmanager.h (-6 / +7 lines)
Lines 12-17 Link Here
12
12
13
#include <tqstring.h>
13
#include <tqstring.h>
14
#include <tqptrvector.h>
14
#include <tqptrvector.h>
15
#include <kpixmap.h>
15
16
16
#include <tqdatetime.h>
17
#include <tqdatetime.h>
17
#include <KBackgroundIface.h>
18
#include <KBackgroundIface.h>
Lines 37-43 Link Here
37
    int hash;
38
    int hash;
38
    int atime;
39
    int atime;
39
    int exp_from;
40
    int exp_from;
40
    KPixmap *pixmap;
41
    KPixmap pixmap;
41
};
42
};
42
43
43
44
Lines 105-116 Link Here
105
106
106
    void renderBackground(int desk);
107
    void renderBackground(int desk);
107
    void exportBackground(int pixmap, int desk);
108
    void exportBackground(int pixmap, int desk);
108
    int pixmapSize(TQPixmap *pm);
109
    int pixmapSize(const TQPixmap &pm);
109
    int cacheSize();
110
    int cacheSize();
110
    void removeCache(int desk);
111
    void removeCache(int desk);
111
    bool freeCache(int size);
112
    bool freeCache(int size);
112
    void addCache(KPixmap *pm, int hash, int desk);
113
    void addCache(const KPixmap &pm, int hash, int desk);
113
    void setPixmap(KPixmap *pm, int hash, int desk);
114
    void setPixmap(const KPixmap &pm, int hash, int desk);
114
115
115
    bool m_bExport, m_bCommon;
116
    bool m_bExport, m_bCommon;
116
    bool m_bLimitCache, m_bInit;
117
    bool m_bLimitCache, m_bInit;
Lines 124-130 Link Here
124
    TQWidget *m_pDesktop;
125
    TQWidget *m_pDesktop;
125
    TQTimer *m_pTimer;
126
    TQTimer *m_pTimer;
126
127
127
    KPixmap *m_tPixmap;
128
    KPixmap m_tPixmap;
128
	
129
	
129
    TQPtrVector<KVirtualBGRenderer> m_Renderer;
130
    TQPtrVector<KVirtualBGRenderer> m_Renderer;
130
    TQPtrVector<KBackgroundCacheEntry> m_Cache;
131
    TQPtrVector<KBackgroundCacheEntry> m_Cache;
Lines 138-144 Link Here
138
    TQTimer * m_crossTimer;
139
    TQTimer * m_crossTimer;
139
    double mAlpha;
140
    double mAlpha;
140
    TQPixmap  mNextScreen;
141
    TQPixmap  mNextScreen;
141
    TQPixmap  * mOldScreen;
142
    TQPixmap  mOldScreen;
142
    int fadeDesk;
143
    int fadeDesk;
143
    TQTime mBenchmark;
144
    TQTime mBenchmark;
144
    bool crossInit;
145
    bool crossInit;
(-)tdebase-trinity-14.0.13_/kdesktop/bgmanager.cpp (-47 / +39 lines)
Lines 93-99 Link Here
93
    for (unsigned i=0; i<m_Renderer.size(); i++)
93
    for (unsigned i=0; i<m_Renderer.size(); i++)
94
    {
94
    {
95
	m_Cache.insert(i, new KBackgroundCacheEntry);
95
	m_Cache.insert(i, new KBackgroundCacheEntry);
96
        m_Cache[i]->pixmap = 0L;
96
        m_Cache[i]->pixmap = KPixmap();
97
        m_Cache[i]->hash = 0;
97
        m_Cache[i]->hash = 0;
98
        m_Cache[i]->exp_from = -1;
98
        m_Cache[i]->exp_from = -1;
99
        m_Renderer.insert (i, new KVirtualBGRenderer(i,m_pConfig));
99
        m_Renderer.insert (i, new KVirtualBGRenderer(i,m_pConfig));
Lines 102-109 Link Here
102
    }
102
    }
103
103
104
#ifdef COMPOSITE
104
#ifdef COMPOSITE
105
    m_tPixmap = new KPixmap(kapp->desktop()->size());
105
    m_tPixmap = KPixmap(kapp->desktop()->size());
106
    m_tPixmap->fill(TQColor(0, 0x0));
106
    m_tPixmap.fill(TQColor(0, 0x0));
107
    connect(myApp, TQT_SIGNAL(cmBackgroundChanged( bool )),
107
    connect(myApp, TQT_SIGNAL(cmBackgroundChanged( bool )),
108
            TQT_SLOT(slotCmBackgroundChanged( bool )));
108
            TQT_SLOT(slotCmBackgroundChanged( bool )));
109
#endif
109
#endif
Lines 175-184 Link Here
175
        return;
175
        return;
176
176
177
    for (unsigned i=0; i<m_Cache.size(); i++)
177
    for (unsigned i=0; i<m_Cache.size(); i++)
178
    {
179
        delete m_Cache[i]->pixmap;
180
        delete m_Cache[i];
178
        delete m_Cache[i];
181
    }
182
}
179
}
183
180
184
181
Lines 334-340 Link Here
334
	for (int i=oldsz; i<num; i++)
331
	for (int i=oldsz; i<num; i++)
335
	{
332
	{
336
	    m_Cache.insert(i, new KBackgroundCacheEntry);
333
	    m_Cache.insert(i, new KBackgroundCacheEntry);
337
	    m_Cache[i]->pixmap = 0L;
334
	    m_Cache[i]->pixmap = KPixmap();
338
	    m_Cache[i]->hash = 0;
335
	    m_Cache[i]->hash = 0;
339
	    m_Cache[i]->exp_from = -1;
336
	    m_Cache[i]->exp_from = -1;
340
            m_Renderer.insert(i, new KVirtualBGRenderer(i,m_pConfig));
337
            m_Renderer.insert(i, new KVirtualBGRenderer(i,m_pConfig));
Lines 382-388 Link Here
382
    // If we have the background already rendered: set it
379
    // If we have the background already rendered: set it
383
    for (unsigned i=0; i<m_Cache.size(); i++)
380
    for (unsigned i=0; i<m_Cache.size(); i++)
384
    {
381
    {
385
	if (!m_Cache[i]->pixmap)
382
	if (m_Cache[i]->pixmap.isNull())
386
	    continue;
383
	    continue;
387
	if (m_Cache[i]->hash != m_Renderer[edesk]->hash())
384
	if (m_Cache[i]->hash != m_Renderer[edesk]->hash())
388
	    continue;
385
	    continue;
Lines 392-397 Link Here
392
	setPixmap(m_Cache[i]->pixmap, m_Cache[i]->hash, i);
389
	setPixmap(m_Cache[i]->pixmap, m_Cache[i]->hash, i);
393
	m_Cache[i]->atime = m_Serial;
390
	m_Cache[i]->atime = m_Serial;
394
	exportBackground(i, desk);
391
	exportBackground(i, desk);
392
395
	return;
393
	return;
396
    }
394
    }
397
395
Lines 443-449 Link Here
443
    // If we have the background already rendered: set it
441
    // If we have the background already rendered: set it
444
    for (unsigned i=0; i<m_Cache.size(); i++)
442
    for (unsigned i=0; i<m_Cache.size(); i++)
445
    {
443
    {
446
        if (!m_Cache[i]->pixmap)
444
        if (m_Cache[i]->pixmap.isNull())
447
            continue;
445
            continue;
448
        if (m_Cache[i]->hash != m_Renderer[edesk]->hash())
446
        if (m_Cache[i]->hash != m_Renderer[edesk]->hash())
449
            continue;
447
            continue;
Lines 490-505 Link Here
490
/*
488
/*
491
 * Paint the pixmap to the root window.
489
 * Paint the pixmap to the root window.
492
 */
490
 */
493
void KBackgroundManager::setPixmap(KPixmap *pm, int hash, int desk)
491
void KBackgroundManager::setPixmap(const KPixmap &pm, int hash, int desk)
494
{
492
{
495
    KPixmap *ep = pm;
493
    KPixmap ep = pm;
496
494
497
#ifdef COMPOSITE
495
#ifdef COMPOSITE
498
    if (argb_visual && (KDesktopSettings::backgroundOpacity() < 100
496
    if (argb_visual && (KDesktopSettings::backgroundOpacity() < 100
499
        || myApp->cmBackground()))
497
        || myApp->cmBackground()))
500
    {
498
    {
501
        ep = m_tPixmap;
499
        ep = m_tPixmap;
502
        if (KDesktopSettings::backgroundOpacity() > 0 && pm
500
        if (KDesktopSettings::backgroundOpacity() > 0 && !pm.isNull()
503
            && !myApp->cmBackground())
501
            && !myApp->cmBackground())
504
        {
502
        {
505
            XRenderPictFormat *format;
503
            XRenderPictFormat *format;
Lines 514-526 Link Here
514
            fillColor.alpha = color;
512
            fillColor.alpha = color;
515
513
516
            Picture fill = XRenderCreateSolidFill (tqt_xdisplay(), &fillColor);
514
            Picture fill = XRenderCreateSolidFill (tqt_xdisplay(), &fillColor);
517
            Picture src = XRenderCreatePicture(tqt_xdisplay(), pm->handle(),
515
            Picture src = XRenderCreatePicture(tqt_xdisplay(), pm.handle(),
518
                                               format, 0, NULL);
516
                                               format, 0, NULL);
519
            Picture dst = XRenderCreatePicture(tqt_xdisplay(), ep->handle(),
517
            Picture dst = XRenderCreatePicture(tqt_xdisplay(), ep.handle(),
520
                                               format, 0, NULL);
518
                                               format, 0, NULL);
521
519
522
            XRenderComposite (tqt_xdisplay(), PictOpSrc, src, fill, dst, 0, 0, 0,
520
            XRenderComposite (tqt_xdisplay(), PictOpSrc, src, fill, dst, 0, 0, 0,
523
                              0, 0, 0, pm->width(), pm->height());
521
                              0, 0, 0, pm.width(), pm.height());
524
522
525
            XRenderFreePicture (tqt_xdisplay(), fill);
523
            XRenderFreePicture (tqt_xdisplay(), fill);
526
            XRenderFreePicture (tqt_xdisplay(), src);
524
            XRenderFreePicture (tqt_xdisplay(), src);
Lines 536-542 Link Here
536
         // Qt eats repaint events in this case :-((
534
         // Qt eats repaint events in this case :-((
537
         sv->viewport()->update();
535
         sv->viewport()->update();
538
       }
536
       }
539
       m_pDesktop->setErasePixmap(*ep);
537
       m_pDesktop->setErasePixmap(ep);
540
       m_pDesktop->repaint();
538
       m_pDesktop->repaint();
541
       static bool root_cleared = false;
539
       static bool root_cleared = false;
542
       if( !root_cleared )
540
       if( !root_cleared )
Lines 544-561 Link Here
544
          root_cleared = true;
542
          root_cleared = true;
545
	  TQTimer::singleShot( 0, this, TQT_SLOT( clearRoot()));
543
	  TQTimer::singleShot( 0, this, TQT_SLOT( clearRoot()));
546
          // but make the pixmap visible until m_pDesktop is visible
544
          // but make the pixmap visible until m_pDesktop is visible
547
          TQT_TQWIDGET(TDEApplication::desktop()->screen())->setErasePixmap(*ep);
545
          TQT_TQWIDGET(TDEApplication::desktop()->screen())->setErasePixmap(ep);
548
          TQT_TQWIDGET(TDEApplication::desktop()->screen())->erase();
546
          TQT_TQWIDGET(TDEApplication::desktop()->screen())->erase();
549
       }
547
       }
550
    }
548
    }
551
    else
549
    else
552
    {
550
    {
553
        TQT_TQWIDGET(TDEApplication::desktop()->screen())->setErasePixmap(*ep);
551
        TQT_TQWIDGET(TDEApplication::desktop()->screen())->setErasePixmap(ep);
554
        TQT_TQWIDGET(TDEApplication::desktop()->screen())->erase();
552
        TQT_TQWIDGET(TDEApplication::desktop()->screen())->erase();
555
    }
553
    }
556
554
557
     // and export it via Esetroot-style for gnome/GTK apps to share in the pretties
555
     // and export it via Esetroot-style for gnome/GTK apps to share in the pretties
558
    Pixmap bgPm = pm->handle(); // fetch the actual X handle to it
556
    Pixmap bgPm = pm.handle(); // fetch the actual X handle to it
559
    //kdDebug() << "Esetroot compat:  setting pixmap to " << bgPm << endl;
557
    //kdDebug() << "Esetroot compat:  setting pixmap to " << bgPm << endl;
560
558
561
    // don't set the ESETROOT_PMAP_ID property - that would result in possible XKillClient()
559
    // don't set the ESETROOT_PMAP_ID property - that would result in possible XKillClient()
Lines 605-619 Link Here
605
        mAlpha = 1;
603
        mAlpha = 1;
606
        m_crossTimer->stop();
604
        m_crossTimer->stop();
607
        KPixmap pixm(mNextScreen);
605
        KPixmap pixm(mNextScreen);
608
        setPixmap(&pixm, r->hash(), fadeDesk);
606
        setPixmap(pixm, r->hash(), fadeDesk);
609
        return;
607
        return;
610
    }
608
    }
611
    // Reset Timer
609
    // Reset Timer
612
    mBenchmark.start();
610
    mBenchmark.start();
613
611
614
    TQPixmap dst = crossFade(*mOldScreen, mNextScreen, mAlpha, crossInit);
612
    TQPixmap dst = crossFade(mOldScreen, mNextScreen, mAlpha, crossInit);
615
    KPixmap pixm(dst);
613
    KPixmap pixm(dst);
616
    setPixmap(&pixm, r->hash(), fadeDesk);
614
    setPixmap(pixm, r->hash(), fadeDesk);
617
615
618
    mAlpha -=0.03;
616
    mAlpha -=0.03;
619
    crossInit = false;
617
    crossInit = false;
Lines 631-637 Link Here
631
        m_numberOfViewports = 1;
629
        m_numberOfViewports = 1;
632
    }
630
    }
633
631
634
    KPixmap *pm = new KPixmap();
632
    KPixmap pm = KPixmap();
635
    KVirtualBGRenderer *r = m_Renderer[desk];
633
    KVirtualBGRenderer *r = m_Renderer[desk];
636
    bool do_cleanup = true;
634
    bool do_cleanup = true;
637
    fadeDesk = desk;
635
    fadeDesk = desk;
Lines 639-645 Link Here
639
    int width,height;
637
    int width,height;
640
638
641
639
642
    *pm = r->pixmap();
640
    pm = r->pixmap();
643
    // If current: paint it
641
    // If current: paint it
644
    bool current = (r->hash() == m_Renderer[effectiveDesktop()]->hash());
642
    bool current = (r->hash() == m_Renderer[effectiveDesktop()]->hash());
645
    if (current)
643
    if (current)
Lines 653-672 Link Here
653
            if (mode == KBackgroundSettings::NoWallpaper || mode == KBackgroundSettings::Tiled || mode  == KBackgroundSettings::CenterTiled ){
651
            if (mode == KBackgroundSettings::NoWallpaper || mode == KBackgroundSettings::Tiled || mode  == KBackgroundSettings::CenterTiled ){
654
                mNextScreen = TQPixmap(width,height);
652
                mNextScreen = TQPixmap(width,height);
655
                TQPainter p (&mNextScreen);
653
                TQPainter p (&mNextScreen);
656
                p.drawTiledPixmap(0,0,width,height,*pm);
654
                p.drawTiledPixmap(0,0,width,height,pm);
657
            } else {
655
            } else {
658
                mNextScreen = TQPixmap(*pm);
656
                mNextScreen = TQPixmap(pm);
659
            }
657
            }
660
658
659
	    TQPixmap *mOldScreen_ = NULL;
661
            if (m_pDesktop){
660
            if (m_pDesktop){
662
                mOldScreen = const_cast<TQPixmap *>( m_pDesktop->backgroundPixmap() );
661
                mOldScreen_ = const_cast<TQPixmap *>( m_pDesktop->backgroundPixmap() );
663
            }else{
662
            }else{
664
                mOldScreen = const_cast<TQPixmap *>(
663
                mOldScreen_ = const_cast<TQPixmap *>(
665
                TQApplication::desktop()->screen()->backgroundPixmap() );
664
                TQApplication::desktop()->screen()->backgroundPixmap() );
666
            }
665
            }
667
666
668
            //TODO Find a way to discover if CrossFade effect needs to run
667
            //TODO Find a way to discover if CrossFade effect needs to run
669
            if (mOldScreen){
668
            if (mOldScreen_){
669
		mOldScreen = *mOldScreen_;
670
                crossInit = true;
670
                crossInit = true;
671
                m_crossTimer->start(70);
671
                m_crossTimer->start(70);
672
            } else{
672
            } else{
Lines 688-696 Link Here
688
    if (m_bExport || !m_bCommon) {
688
    if (m_bExport || !m_bCommon) {
689
	addCache(pm, r->hash(), desk);
689
	addCache(pm, r->hash(), desk);
690
    }
690
    }
691
    else {
692
        delete pm;
693
    }
694
691
695
    if (current) {
692
    if (current) {
696
        exportBackground(desk, realDesktop());
693
        exportBackground(desk, realDesktop());
Lines 717-725 Link Here
717
/*
714
/*
718
 * Size in bytes of a TQPixmap. For use in the pixmap cache.
715
 * Size in bytes of a TQPixmap. For use in the pixmap cache.
719
 */
716
 */
720
int KBackgroundManager::pixmapSize(TQPixmap *pm)
717
int KBackgroundManager::pixmapSize(const TQPixmap &pm)
721
{
718
{
722
    return (pm->width() * pm->height()) * ((pm->depth() + 7) / 8);
719
    return (pm.width() * pm.height()) * ((pm.depth() + 7) / 8);
723
}
720
}
724
721
725
722
Lines 731-737 Link Here
731
    int total = 0;
728
    int total = 0;
732
    for (unsigned i=0; i<m_Cache.size(); i++)
729
    for (unsigned i=0; i<m_Cache.size(); i++)
733
    {
730
    {
734
        if (m_Cache[i]->pixmap)
731
        if (!m_Cache[i]->pixmap.isNull())
735
            total += pixmapSize(m_Cache[i]->pixmap);
732
            total += pixmapSize(m_Cache[i]->pixmap);
736
    }
733
    }
737
    return total;
734
    return total;
Lines 745-753 Link Here
745
{
742
{
746
    if (m_bExport)
743
    if (m_bExport)
747
	m_pPixmapServer->remove(KRootPixmap::pixmapName(desk+1));
744
	m_pPixmapServer->remove(KRootPixmap::pixmapName(desk+1));
748
    else
745
    m_Cache[desk]->pixmap = KPixmap();
749
        delete m_Cache[desk]->pixmap;
750
    m_Cache[desk]->pixmap = 0L;
751
    m_Cache[desk]->hash = 0;
746
    m_Cache[desk]->hash = 0;
752
    m_Cache[desk]->exp_from = -1;
747
    m_Cache[desk]->exp_from = -1;
753
    m_Cache[desk]->atime = 0;
748
    m_Cache[desk]->atime = 0;
Lines 784-790 Link Here
784
	min = m_Serial+1; j = 0;
779
	min = m_Serial+1; j = 0;
785
	for (unsigned i=0; i<m_Cache.size(); i++)
780
	for (unsigned i=0; i<m_Cache.size(); i++)
786
	{
781
	{
787
	    if (m_Cache[i]->pixmap && (m_Cache[i]->atime < min))
782
	    if (!m_Cache[i]->pixmap.isNull() && (m_Cache[i]->atime < min))
788
	    {
783
	    {
789
		min = m_Cache[i]->atime;
784
		min = m_Cache[i]->atime;
790
		j = i;
785
		j = i;
Lines 800-814 Link Here
800
 * Try to add a pixmap to the pixmap cache. We don't use TQPixmapCache here
795
 * Try to add a pixmap to the pixmap cache. We don't use TQPixmapCache here
801
 * because if we're exporting pixmaps, this needs special care.
796
 * because if we're exporting pixmaps, this needs special care.
802
 */
797
 */
803
void KBackgroundManager::addCache(KPixmap *pm, int hash, int desk)
798
void KBackgroundManager::addCache(const KPixmap &pm, int hash, int desk)
804
{
799
{
805
    if (m_Cache[desk]->pixmap)
800
    if (!m_Cache[desk]->pixmap.isNull())
806
	removeCache(desk);
801
	removeCache(desk);
807
802
808
    if (m_bLimitCache && !m_bExport && !freeCache(pixmapSize(pm)))
803
    if (m_bLimitCache && !m_bExport && !freeCache(pixmapSize(pm)))
809
    {
804
    {
810
	// pixmap does not fit in cache
805
	// pixmap does not fit in cache
811
	delete pm;
812
	return;
806
	return;
813
    }
807
    }
814
808
Lines 1024-1033 Link Here
1024
    }
1018
    }
1025
1019
1026
#ifdef COMPOSITE
1020
#ifdef COMPOSITE
1027
    if (m_tPixmap)
1021
    m_tPixmap = KPixmap(kapp->desktop()->size());
1028
	delete m_tPixmap;
1022
    m_tPixmap.fill(TQColor(0, 0x0));
1029
    m_tPixmap = new KPixmap(kapp->desktop()->size());
1030
    m_tPixmap->fill(TQColor(0, 0x0));
1031
#endif
1023
#endif
1032
    
1024
    
1033
    m_Hash = 0;
1025
    m_Hash = 0;
Lines 1100-1106 Link Here
1100
#ifdef COMPOSITE
1092
#ifdef COMPOSITE
1101
void KBackgroundManager::slotCmBackgroundChanged( bool )
1093
void KBackgroundManager::slotCmBackgroundChanged( bool )
1102
{
1094
{
1103
    m_tPixmap->fill(TQColor(0, 0x0));
1095
    m_tPixmap.fill(TQColor(0, 0x0));
1104
    m_Hash = 0;
1096
    m_Hash = 0;
1105
    slotChangeDesktop(0);
1097
    slotChangeDesktop(0);
1106
}
1098
}
(-)tdebase-trinity-14.0.13_/kdesktop/pixmapserver.h (-2 / +2 lines)
Lines 30-36 Link Here
30
30
31
struct KPixmapData
31
struct KPixmapData
32
{
32
{
33
    TQPixmap *pixmap;
33
    TQPixmap pixmap;
34
    int usecount;
34
    int usecount;
35
    int refcount;
35
    int refcount;
36
};
36
};
Lines 70-76 Link Here
70
     * @param pm A pointer to the pixmap.
70
     * @param pm A pointer to the pixmap.
71
     * @param overwrite Should an pixmap with the same name be overwritten?
71
     * @param overwrite Should an pixmap with the same name be overwritten?
72
     */
72
     */
73
    void add(TQString name, TQPixmap *pm, bool overwrite=true);
73
    void add(TQString name, const TQPixmap &pm, bool overwrite=true);
74
74
75
    /**
75
    /**
76
     * Remove a pixmap from the server. This will delete the pixmap after 
76
     * Remove a pixmap from the server. This will delete the pixmap after 
(-)tdebase-trinity-14.0.13_/kdesktop/pixmapserver.cpp (-16 / +6 lines)
Lines 49-62 Link Here
49
    SelectionIterator it;
49
    SelectionIterator it;
50
    for (it=m_Selections.begin(); it!=m_Selections.end(); it++)
50
    for (it=m_Selections.begin(); it!=m_Selections.end(); it++)
51
	XSetSelectionOwner(tqt_xdisplay(), it.key(), None, CurrentTime);
51
	XSetSelectionOwner(tqt_xdisplay(), it.key(), None, CurrentTime);
52
53
    DataIterator it2;
54
    for (it2=m_Data.begin(); it2!=m_Data.end(); it2++)
55
	delete it2.data().pixmap;
56
}
52
}
57
53
58
54
59
void KPixmapServer::add(TQString name, TQPixmap *pm, bool overwrite)
55
void KPixmapServer::add(TQString name, const TQPixmap &pm, bool overwrite)
60
{
56
{
61
    if (m_Names.contains(name)) 
57
    if (m_Names.contains(name)) 
62
    {
58
    {
Lines 68-90 Link Here
68
    TQString str = TQString("KDESHPIXMAP:%1").arg(name);
64
    TQString str = TQString("KDESHPIXMAP:%1").arg(name);
69
    Atom sel = XInternAtom(tqt_xdisplay(), str.latin1(), false);
65
    Atom sel = XInternAtom(tqt_xdisplay(), str.latin1(), false);
70
    KPixmapInode pi;
66
    KPixmapInode pi;
71
    pi.handle = pm->handle();
67
    pi.handle = pm.handle();
72
    pi.selection = sel;
68
    pi.selection = sel;
73
    m_Names[name] = pi;
69
    m_Names[name] = pi;
74
70
75
    TDESelectionInode si;
71
    TDESelectionInode si;
76
    si.name = name;
72
    si.name = name;
77
    si.handle = pm->handle();
73
    si.handle = pm.handle();
78
    m_Selections[sel] = si;
74
    m_Selections[sel] = si;
79
75
80
    DataIterator it = m_Data.find(pm->handle());
76
    DataIterator it = m_Data.find(pm.handle());
81
    if (it == m_Data.end()) 
77
    if (it == m_Data.end()) 
82
    {
78
    {
83
	KPixmapData data;
79
	KPixmapData data;
84
	data.pixmap = pm;
80
	data.pixmap = pm;
85
	data.usecount = 0;
81
	data.usecount = 0;
86
	data.refcount = 1;
82
	data.refcount = 1;
87
	m_Data[pm->handle()] = data;
83
	m_Data[pm.handle()] = data;
88
    } else
84
    } else
89
	it.data().refcount++;
85
	it.data().refcount++;
90
86
Lines 111-121 Link Here
111
    DataIterator it3 = m_Data.find(pi.handle);
107
    DataIterator it3 = m_Data.find(pi.handle);
112
    assert(it3 != m_Data.end());
108
    assert(it3 != m_Data.end());
113
    it3.data().refcount--;
109
    it3.data().refcount--;
114
    if (!it3.data().refcount && !it3.data().usecount) 
110
    if (!it3.data().refcount && !it3.data().usecount)
115
    {
116
	delete it3.data().pixmap;
117
	m_Data.remove(it3);
111
	m_Data.remove(it3);
118
    }
119
}
112
}
120
113
121
114
Lines 226-235 Link Here
226
	assert(it2 != m_Data.end());
219
	assert(it2 != m_Data.end());
227
	it2.data().usecount--;
220
	it2.data().usecount--;
228
	if (!it2.data().usecount && !it2.data().refcount) 
221
	if (!it2.data().usecount && !it2.data().refcount) 
229
	{
230
	    delete it2.data().pixmap;
231
	    m_Data.remove(it2);
222
	    m_Data.remove(it2);
232
	}
233
	return true;
223
	return true;
234
    }
224
    }
235
        
225
        

Return to bug 3164