From 45adc39c2af2a79c89a7ed292915a58b5dfc51e4 Mon Sep 17 00:00:00 2001
From: Alexander Golubev <fatzer2@gmail.com>
Date: Fri, 10 Apr 2026 06:50:49 +0300
Subject: tdeui/kcharselect: handle mouse wheel event to change the table

Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
---
 tdeui/kcharselect.cpp | 13 +++++++++++++
 tdeui/kcharselect.h   |  1 +
 2 files changed, 14 insertions(+)

diff --git a/tdeui/kcharselect.cpp b/tdeui/kcharselect.cpp
index 016e59b78..77d3da0b1 100644
--- a/tdeui/kcharselect.cpp
+++ b/tdeui/kcharselect.cpp
@@ -475,6 +475,7 @@ KCharSelect::KCharSelect( TQWidget *parent, const char *name, const TQString &_f
     charTable->setMinimumSize( sz );
     charTable->setHScrollBarMode( TQScrollView::AlwaysOff );
     charTable->setVScrollBarMode( TQScrollView::AlwaysOff );
+    charTable->installEventFilter( this );
 
     d->scrollBar = new TQScrollBar(0, 255, 1, 1, 0, TQt::Vertical, box);
 
@@ -590,6 +591,7 @@ void KCharSelect::slotUnicodeEntered( )
     charActivated( ch );
 }
 
+//==================================================================
 void KCharSelect::slotUpdateUnicode( const TQChar &c )
 {
     const int uc = c.unicode();
@@ -598,6 +600,17 @@ void KCharSelect::slotUpdateUnicode( const TQChar &c )
     d->unicodeLine->setText(s);
 }
 
+//==================================================================
+bool KCharSelect::eventFilter( TQObject *obj, TQEvent *e )
+{
+    if ( obj == charTable && e->type() == TQEvent::Wheel ) {
+        // just pass charTable's mouse wheel events to the scrollBar
+        return TQApplication::sendEvent( d->scrollBar, e );
+    }
+    return false;
+}
+
+//==================================================================
 void KCharSelectTable::virtual_hook( int, void*)
 { /*BASE::virtual_hook( id, data );*/ }
 
diff --git a/tdeui/kcharselect.h b/tdeui/kcharselect.h
index 6e9e26153..60a067e1e 100644
--- a/tdeui/kcharselect.h
+++ b/tdeui/kcharselect.h
@@ -226,6 +226,7 @@ public:
 
 protected:
     virtual void fillFontCombo();
+    virtual bool eventFilter( TQObject *, TQEvent *e );
     static void cleanupFontDatabase();
 
     TQComboBox *fontCombo;
-- 
cgit v1.2.3

