summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2004-11-09 16:35:08 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2004-11-09 16:35:08 +0000
commiteaee557b03859894f4f331f4b24d1e05003ad150 (patch)
treecaa6f3b5fca32be32be024ab2272b3cb2df4e682 /vcl
parent3dee3cb2bffc45c85df89ee33b28725aa2bc39a6 (diff)
INTEGRATION: CWS vcl28 (1.5.14); FILE MERGED
2004/10/07 10:18:34 pl 1.5.14.4: #i35073# better key release swallow mechanism 2004/10/01 14:48:30 pl 1.5.14.3: #i34880# IM patch 2004/09/30 14:14:46 pl 1.5.14.2: #i34504# don't set max size hint and fullscreen hint at the same time 2004/09/30 11:07:59 pl 1.5.14.1: join from vcl27
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkframe.hxx121
1 files changed, 90 insertions, 31 deletions
diff --git a/vcl/unx/inc/plugins/gtk/gtkframe.hxx b/vcl/unx/inc/plugins/gtk/gtkframe.hxx
index 5b5fd3514a78..e576e52d0d92 100644
--- a/vcl/unx/inc/plugins/gtk/gtkframe.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkframe.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: gtkframe.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: hr $ $Date: 2004-10-13 08:58:36 $
+ * last change: $Author: hr $ $Date: 2004-11-09 17:35:08 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -76,6 +76,8 @@
#include <sysdata.hxx>
#endif
+#include <list>
+
class X11SalGraphics;
class GtkSalDisplay;
@@ -94,31 +96,87 @@ class GtkSalFrame : public SalFrame
~GraphicsHolder();
};
- GtkWindow* m_pWindow;
- GdkWindow* m_pForeignParent;
- GdkWindow* m_pForeignTopLevel;
- ULONG m_nStyle;
- GtkFixed* m_pFixedContainer;
- GtkSalFrame* m_pParent;
- GdkWindowState m_nState;
- GtkIMContext* m_pIMContext;
- SystemEnvData m_aSystemData;
- GraphicsHolder m_aGraphics[ nMaxGraphics ];
- USHORT m_nKeyModifiers;
- GdkCursor *m_pCurrentCursor;
- GdkVisibilityState m_nVisibility;
- int m_nSavedScreenSaverTimeout;
- bool m_bResizeable;
- bool m_bSingleAltPress;
- bool m_bDefaultPos;
- bool m_bDefaultSize;
- bool m_bSendModChangeOnRelease;
- bool m_bWasPreedit;
-
- Size m_aMaxSize;
- Size m_aMinSize;
-
- GdkEventKey m_aLastKeyPress;
+ //--------------------------------------------------------
+ // Not all GTK Input Methods swallow key release
+ // events. Since they swallow the key press events and we
+ // are left with the key release events, we need to
+ // manually swallow those. To do this, we keep a list of
+ // the previous 10 key press events in each GtkSalFrame
+ // and when we get a key release that matches one of the
+ // key press events in our list, we swallow it.
+ struct PreviousKeyPress
+ {
+ GdkWindow *window;
+ gint8 send_event;
+ guint32 time;
+ guint state;
+ guint keyval;
+
+ PreviousKeyPress (GdkEventKey *event)
+ : window (NULL),
+ send_event (0),
+ time (0),
+ state (0),
+ keyval (0)
+ {
+ if (event)
+ {
+ window = event->window;
+ send_event = event->send_event;
+ time = event->time;
+ state = event->state;
+ keyval = event->keyval;
+ }
+ }
+
+ PreviousKeyPress( const PreviousKeyPress& rPrev )
+ : window( rPrev.window ),
+ send_event( rPrev.send_event ),
+ time( rPrev.time ),
+ state( rPrev.state ),
+ keyval( rPrev.keyval )
+ {}
+
+ bool PreviousKeyPress::operator== (GdkEventKey *event) const
+ {
+ return (event != NULL)
+ && (event->window == window)
+ && (event->send_event == send_event)
+ && (event->state == state)
+ && (event->keyval == keyval)
+ && (event->time - time < 3)
+ ;
+ }
+ };
+
+ GtkWindow* m_pWindow;
+ GdkWindow* m_pForeignParent;
+ GdkWindow* m_pForeignTopLevel;
+ ULONG m_nStyle;
+ GtkFixed* m_pFixedContainer;
+ GtkSalFrame* m_pParent;
+ GdkWindowState m_nState;
+ GtkIMContext* m_pIMContext;
+ SystemEnvData m_aSystemData;
+ GraphicsHolder m_aGraphics[ nMaxGraphics ];
+ USHORT m_nKeyModifiers;
+ GdkCursor *m_pCurrentCursor;
+ GdkVisibilityState m_nVisibility;
+ int m_nSavedScreenSaverTimeout;
+ bool m_bResizeable;
+ bool m_bFullscreen;
+ bool m_bSingleAltPress;
+ bool m_bDefaultPos;
+ bool m_bDefaultSize;
+ bool m_bSendModChangeOnRelease;
+ bool m_bWasPreedit;
+
+ Size m_aMaxSize;
+ Size m_aMinSize;
+
+ std::list< PreviousKeyPress > m_aPrevKeyPresses;
+ int m_nPrevKeyPresses; // avoid using size()
+
void Init( SalFrame* pParent, ULONG nStyle );
void Init( SystemParentData* pSysData );
@@ -169,6 +227,7 @@ class GtkSalFrame : public SalFrame
Size calcDefaultSize();
void setMinMaxSize();
+ void updateIMSpotLocation();
public:
GtkSalFrame( SalFrame* pParent, ULONG nStyle );
GtkSalFrame( SystemParentData* pSysData );
@@ -199,8 +258,8 @@ public:
virtual void SetTitle( const XubString& rTitle );
virtual void SetIcon( USHORT nIcon );
- virtual void SetMenu( SalMenu *pSalMenu );
- virtual void DrawMenuBar();
+ virtual void SetMenu( SalMenu *pSalMenu );
+ virtual void DrawMenuBar();
// Before the window is visible, a resize event
// must be sent with the correct size
@@ -208,8 +267,8 @@ public:
virtual void Enable( BOOL bEnable );
// Set ClientSize and Center the Window to the desktop
// and send/post a resize message
- virtual void SetMinClientSize( long nWidth, long nHeight );
- virtual void SetMaxClientSize( long nWidth, long nHeight );
+ virtual void SetMinClientSize( long nWidth, long nHeight );
+ virtual void SetMaxClientSize( long nWidth, long nHeight );
virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags );
virtual void GetClientSize( long& rWidth, long& rHeight );
virtual void GetWorkArea( Rectangle& rRect );