コード例 #1
0
ファイル: qapp.cpp プロジェクト: nic0lae/freebsddistro
void qapp::toggle_tiled(void) // toggle overlapped/tiled desk 
{
	xwindow *client;
	
	if(smode)
		return;
	
	if(tdesks[adesk])
	{
		for(client = clients.first(); client != NULL; client = clients.next())
		{
			if(is_curdesk(client))
				client->unset_tile();
		}	
			
		tdesks[adesk] = FALSE;
		tmaxclient = NULL;

		if(focusclient != NULL && clients.find(client) != -1)
			focusclient->focus_mouse();
			
		tb_wl->set_pixmap();

		return;
	}
	tile_order(focusclient);
	tdesks[adesk] = TRUE;
	tb_wl->set_pixmap();
}
コード例 #2
0
ファイル: qapp.cpp プロジェクト: iattilagy/qlwm
void qapp::run_client(Window w)  // start new client
{
	xwindow *client;
	int apnumber,format;
	Atom type;
	unsigned long nitems=0;
	unsigned long extra=0;
	unsigned char *data=NULL;

	stopautofocus();

	if((client = cwindows[w]) != NULL)
	{
		client->map();
	}
	else  // new client
	{
		XClassHint ch;
		if(XGetClassHint(QX11Info::display(), w, &ch))
		{
			QString clname(ch.res_class);
			QString cclname(ch.res_name);
			cclname += ',';
			cclname += clname;
			
			XFree(ch.res_name);
			XFree(ch.res_class);
			XGetWindowProperty(QX11Info::display(), w, kde_net_wm_system_tray_window_for, 0, 1L, FALSE, XA_WINDOW, &type, &format, &nitems, &extra, &data);

			if(data != NULL)
				XFree(data);

			if(! clname.isEmpty() && ((apnumber = apclients[clname]) || nitems))
			{
				if(tb_ap->add(w, apnumber, clname))  // add to toolbar
					return;
			}

			if(! cclname.isEmpty() && ((apnumber = apclients[cclname]) || nitems))
			{
				if(tb_ap->add(w, apnumber, cclname))
					return;
			}
		}
		clients.prepend((client = new xwindow(w)));

		if(client->is_tileable() && tdesks[adesk] && ! client->is_unmapped())
		{
			tile_order(tmaxclient);

	    		client->show();
	    		XMapWindow(QX11Info::display(), client->client_id());
	    		client->set_clientstate(NormalState);
	    		XSync(QX11Info::display(), FALSE);
			client->raise();
		}	
	}
}
コード例 #3
0
ファイル: qapp.cpp プロジェクト: nic0lae/freebsddistro
void qapp::tile_maximize(xwindow *client)
{
	int i;
	
	if(tmaxclient != NULL && (i = clients.find(tmaxclient)) != -1)
		clients.insert(clients.find(client),  clients.take(i));
		
	tile_order(client);
}
コード例 #4
0
ファイル: qapp.cpp プロジェクト: zchydem/qtablet
void qapp::run_client(Window w)  // start new client
{
	xwindow *client;
        int format;
	Atom type;
	unsigned long nitems=0;
	unsigned long extra=0;
	unsigned char *data=NULL;

        stopautofocus();

        qDebug() << "qapp::run_client";
	if((client = cwindows[w]) != NULL)
	{                
                client->map();                
	}
	else  // new client
	{
		XClassHint ch;
		if(XGetClassHint(QX11Info::display(), w, &ch))
		{
			QString clname(ch.res_class);
			QString cclname(ch.res_name);
			cclname += ',';
			cclname += clname;
			
			XFree(ch.res_name);
			XFree(ch.res_class);
			XGetWindowProperty(QX11Info::display(), w, kde_net_wm_system_tray_window_for, 0, 1L, FALSE, XA_WINDOW, &type, &format, &nitems, &extra, &data);

			if(data != NULL)
				XFree(data);

		}


                client = new xwindow(w);
                clients.prepend(client);                

		if(client->is_tileable() && tdesks[adesk] && ! client->is_unmapped())
		{
			tile_order(tmaxclient);

                        client->show();
	    		XMapWindow(QX11Info::display(), client->client_id());
	    		client->set_clientstate(NormalState);                        
	    		XSync(QX11Info::display(), FALSE);
			client->raise();
                        qDebug()  << "New client created and raised **";
		}	
	}
}
コード例 #5
0
ファイル: qapp.cpp プロジェクト: nic0lae/freebsddistro
void qapp::run_client(Window w)  // start new client
{
	xwindow *client;
	int apnumber;

	if((client = cwindows.find(w)) != NULL)
	{
		client->map();
	}
	else  // new client
	{
		XClassHint ch;
		if(XGetClassHint(qt_xdisplay(), w, &ch))
		{
			QString clname(ch.res_class);
			QString cclname(ch.res_name);
			cclname += ',';
			cclname += clname;
			
			XFree(ch.res_name);
			XFree(ch.res_class);

			if(! clname.isEmpty() && (apnumber = apclients[clname])) 
			{
				if(tb_ap->add(w, apnumber, clname))  // add to toolbar
					return;
			}

			if(! cclname.isEmpty() && (apnumber = apclients[cclname])) 
			{
				if(tb_ap->add(w, apnumber, cclname))
					return;
			}
		}
		clients.prepend((client = new xwindow(w)));

		if(client->is_tileable() && tdesks[adesk] && ! client->is_unmapped())
		{
			tile_order(tmaxclient);

	    		client->show();
	    		XMapWindow(qt_xdisplay(), client->client_id());
	    		client->set_clientstate(NormalState);
	    		XSync(qt_xdisplay(), FALSE);
			client->raise();
		}	
	}
}