示例#1
1
bool Ctrl::SetWndFocus()
{
	GuiLock __;
	LLOG("SetWndFocus0 " << Upp::Name(this) << ", top: " << top);
	if(top) {
		LLOG("SetWndFocus0 DO gdk: " << gdk());
		SetWndForeground();
		int t0 = msecs();
		while(!gtk_window_is_active(gtk()) && msecs() - t0 < 500) // Wait up to 500ms for window to become active - not ideal, but only possibility
			FetchEvents(true);
		FocusSync();
	}
	return true;
}
示例#2
0
文件: main.cpp 项目: evoL/sag
int main(int argc, char *argv[]) {
    Gtk::Main gtk(argc, argv);
    sag::GUI gui;
    gtk.run(gui);
    
    return 0;
}
示例#3
0
bool
gtk_core_init (Ekiga::ServiceCore &core,
	       int *argc,
	       char **argv[])
{
  if (gtk_init_check (argc, argv)) {

    boost::shared_ptr<Gtk::Core> gtk (new Gtk::Core);

    core.add (gtk);

    return true;

  } else
    return false;
}
示例#4
0
static bool tryUnity() {
    static bool init = false;
    static bool good = false;
    if (!init) {
        init = true;
        _Debug("DE is Unity. Fallback to AppIndicator instead of QSytemTrayIcon.");
        QLibrary gtk(u"gtk-x11-2.0"_q, 0), ai(u"libappindicator"_q, 1);
        if (!gtk.load() || !ai.load())
            return false;
        auto lib = &gtk;
#define DEC_FUNC(name) if (!(name = (f_##name)lib->resolve(#name))) return false;
        DEC_FUNC(gtk_menu_new)
        DEC_FUNC(gtk_menu_item_new_with_label)
        DEC_FUNC(gtk_menu_shell_append)
        DEC_FUNC(gtk_widget_show)
        lib = &ai;
        DEC_FUNC(app_indicator_new)
        DEC_FUNC(app_indicator_set_menu)
        DEC_FUNC(app_indicator_set_status)
#undef DEC_FUNC
        good = true;
    }
    return good;
}
示例#5
0
bool Ctrl::HasWndFocus() const
{
	GuiLock __;
	return IsOpen() && gtk_window_is_active(gtk());
}
示例#6
0
bool Ctrl::IsWndForeground() const
{
	GuiLock __;
	LLOG("IsWndForeground");
	return IsOpen() && gtk_window_is_active(gtk());
}
示例#7
0
void Ctrl::SetWndForeground()
{
	GuiLock __;
	if(IsOpen())
		gtk_window_present(gtk());
}