x11: Drop support for private colormaps

According to 4b686a204250b4416fce79fa55b8a89c5193de38 in kde-workspace,
the support for private colormaps was mainly useful to 8bit displays,
which are relic of time now.
This commit is contained in:
Vlad Zahorodnii 2023-09-21 13:47:10 +03:00
parent 425f0a40e0
commit 6d8cdef33e
4 changed files with 0 additions and 56 deletions

View file

@ -79,32 +79,6 @@ X11EventFilter *X11EventFilterContainer::filter() const
return m_filter;
}
ColorMapper::ColorMapper(QObject *parent)
: QObject(parent)
{
const xcb_screen_t *screen = Xcb::defaultScreen();
m_default = screen->default_colormap;
m_installed = screen->default_colormap;
}
ColorMapper::~ColorMapper()
{
}
void ColorMapper::update()
{
xcb_colormap_t cmap = m_default;
if (X11Window *c = dynamic_cast<X11Window *>(Workspace::self()->activeWindow())) {
if (c->colormap() != XCB_COLORMAP_NONE) {
cmap = c->colormap();
}
}
if (cmap != m_installed) {
xcb_install_colormap(kwinApp()->x11Connection(), cmap);
m_installed = cmap;
}
}
Workspace *Workspace::_self = nullptr;
Workspace::Workspace()
@ -291,8 +265,6 @@ void Workspace::initializeX11()
// first initialize the extensions
Xcb::Extensions::self();
m_colorMapper = std::make_unique<ColorMapper>(this);
connect(this, &Workspace::windowActivated, m_colorMapper.get(), &ColorMapper::update);
// Call this before XSelectInput() on the root window
m_startup = std::make_unique<KStartupInfo>(KStartupInfo::DisableKWinModule | KStartupInfo::AnnounceSilenceChanges, this);
@ -441,7 +413,6 @@ void Workspace::cleanupX11()
RootInfo::destroy();
Xcb::Extensions::destroy();
m_colorMapper.reset();
m_movingClientFilter.reset();
m_startup.reset();
m_nullFocus.reset();

View file

@ -52,7 +52,6 @@ class TabBox;
class Window;
class Output;
class ColorMapper;
class Compositor;
class Group;
class InternalWindow;
@ -682,7 +681,6 @@ private:
static Workspace *_self;
std::unique_ptr<KStartupInfo> m_startup;
std::unique_ptr<ColorMapper> m_colorMapper;
QHash<const VirtualDesktop *, QRectF> m_workAreas;
QHash<const VirtualDesktop *, StrutRects> m_restrictedAreas;
@ -750,20 +748,6 @@ private:
Workspace *ws;
};
class ColorMapper : public QObject
{
Q_OBJECT
public:
ColorMapper(QObject *parent);
~ColorMapper() override;
public Q_SLOTS:
void update();
private:
xcb_colormap_t m_default;
xcb_colormap_t m_installed;
};
//---------------------------------------------------------
// Unsorted

View file

@ -288,7 +288,6 @@ X11Window::X11Window()
, shade_below(nullptr)
, m_motif(atoms->motif_wm_hints)
, blocks_compositing(false)
, m_colormap(XCB_COLORMAP_NONE)
, in_group(nullptr)
, ping_timer(nullptr)
, m_killHelperPID(0)
@ -632,8 +631,6 @@ bool X11Window::manage(xcb_window_t w, bool isMapped)
// If it's already mapped, ignore hint
bool init_minimize = !isMapped && (info->initialMappingState() == NET::Iconic);
m_colormap = attr->colormap;
getResourceClass();
readWmClientLeader(wmClientLeaderCookie);
getWmClientMachine();

View file

@ -191,8 +191,6 @@ public:
bool providesContextHelp() const override;
xcb_colormap_t colormap() const;
/// Updates visibility depending on being shaded, virtual desktop, etc.
void updateVisibility();
bool hiddenPreview() const; ///< Window is mapped in order to get a window pixmap
@ -478,7 +476,6 @@ private:
} m_fullscreenMode;
MaximizeMode max_mode;
xcb_colormap_t m_colormap;
QString cap_normal, cap_iconic, cap_suffix;
Group *in_group;
QTimer *ping_timer;
@ -586,11 +583,6 @@ inline bool X11Window::hasNETSupport() const
return info->hasNETSupport();
}
inline xcb_colormap_t X11Window::colormap() const
{
return m_colormap;
}
inline int X11Window::sessionStackingOrder() const
{
return sm_stacking_order;