Пример #1
0
void EnableInterface() {
  guis_need_update = 1;
  play.disabled_user_interface--;
  if (play.disabled_user_interface<1) {
    play.disabled_user_interface=0;
    set_default_cursor();
    }
  }
Пример #2
0
void WindowManager::init_internals(int argc, char* argv[])
{
	DBG("starting window manager");

	fl_open_display();
	XSetErrorHandler(xerror_handler);
	XShapeQueryExtension(fl_display, &XShapeEventBase, &XShapeErrorBase);

	wm_area.set(0, 0/*22*/, Fl::w(), Fl::h()/*-22*/);

	// TODO: make this part of class
	program_name = fl_file_filename(argv[0]);

	int i;
	if(Fl::args(argc, argv, i, arg) < argc)
		Fl::error("options are:\n"
			" -d[isplay] host:#.#\tX display & screen to use\n"
			" -v[isual] #\t\tvisual to use\n"
			" -g[eometry] WxH+X+Y\tlimits windows to this area\n"
			" -x\t\t\tmenu says Exit instead of logout\n"
			" -bg color\t\tFrame color\n"
			" -fg color\t\tLabel color\n"
			" -bg2 color\t\tText field color\n"
			" -cfg color\t\tCursor color\n"
			" -cbg color\t\tCursor outline color" );

	// Init started
	is_init = false;

	Fl::add_handler(wm_event_handler);
	
	// intern atoms
	init_atoms();
	read_configuration();
	read_xset_configuration();
	
	// Set XID now
	show();

	set_default_cursor();
	ICCCM::set_iconsizes(this);
	MWM::set_motif_info(this);
	register_protocols(fl_xid(this));
	Grab_Hotkeys(this);

	XSync(fl_display, 0);

	init_desktops(this);

	//Init done
	is_init = true;

	// find all the windows and create a Frame for each:
	Frame *f=0;
	unsigned int n;
	Window w1, w2, *wins;
	XWindowAttributes attr;
	XQueryTree(fl_display, fl_xid(this), &w1, &w2, &wins, &n);
	for (i = 0; i < (int)n; ++i)
	{
		XGetWindowAttributes(fl_display, wins[i], &attr);
		if(attr.override_redirect) continue;
		if(!attr.map_state)
		{
			if(getIntProperty(wins[i], _XA_WM_STATE, _XA_WM_STATE, 0) != IconicState)
				continue;
		}
		f = new Frame(wins[i], &attr);
	}
	XFree((void *)wins);

	// Activate last one
	for(uint n=0; n<map_order.size(); n++)
	{
		Frame *f = map_order[n];
		if(f->desktop()==Desktop::current())
		{
			f->activate();
			f->raise();
			break;
		}
	}

	update_workarea(true);
	is_running = true;
}