Resolves: rhbz#1401778 gtk3+wayland switching windows from the window woes
ignore 0 timestamps cause they're useless and get the current event time stamp during MenuBarReturnFocus to determine the timestamp of the menu command dispatch Change-Id: Ia4b00aafc9ef47b41dcca2c160e943200db5c524
This commit is contained in:
@@ -546,6 +546,7 @@ public:
|
|||||||
guint* pGdkKeyCode, GdkModifierType *pGdkModifiers);
|
guint* pGdkKeyCode, GdkModifierType *pGdkModifiers);
|
||||||
|
|
||||||
static guint32 GetLastInputEventTime();
|
static guint32 GetLastInputEventTime();
|
||||||
|
static void UpdateLastInputEventTime(guint32 nUserInputTime);
|
||||||
};
|
};
|
||||||
|
|
||||||
#define OOO_TYPE_FIXED ooo_fixed_get_type()
|
#define OOO_TYPE_FIXED ooo_fixed_get_type()
|
||||||
|
@@ -750,6 +750,7 @@ bool GtkSalMenu::TakeFocus()
|
|||||||
|
|
||||||
static void MenuBarReturnFocus(GtkMenuShell*, gpointer menu)
|
static void MenuBarReturnFocus(GtkMenuShell*, gpointer menu)
|
||||||
{
|
{
|
||||||
|
GtkSalFrame::UpdateLastInputEventTime(gtk_get_current_event_time());
|
||||||
GtkSalMenu* pMenu = static_cast<GtkSalMenu*>(menu);
|
GtkSalMenu* pMenu = static_cast<GtkSalMenu*>(menu);
|
||||||
pMenu->ReturnFocus();
|
pMenu->ReturnFocus();
|
||||||
}
|
}
|
||||||
|
@@ -2040,8 +2040,13 @@ guint32 GtkSalFrame::GetLastInputEventTime()
|
|||||||
return nLastUserInputTime;
|
return nLastUserInputTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void UpdateLastInputEventTime(guint32 nUserInputTime)
|
void GtkSalFrame::UpdateLastInputEventTime(guint32 nUserInputTime)
|
||||||
{
|
{
|
||||||
|
//gtk3 can generate a synthetic crossing event with a useless 0
|
||||||
|
//(GDK_CURRENT_TIME) timestamp on showing a menu from the main
|
||||||
|
//menubar, which is unhelpful, so ignore the 0 timestamps
|
||||||
|
if (nUserInputTime == GDK_CURRENT_TIME)
|
||||||
|
return;
|
||||||
nLastUserInputTime = nUserInputTime;
|
nLastUserInputTime = nUserInputTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user