Time timestamp;
wm_sn = g_strdup_printf("WM_S%d", ob_screen);
- wm_sn_atom = XInternAtom(ob_display, wm_sn, FALSE);
+ wm_sn_atom = XInternAtom(obt_display, wm_sn, FALSE);
g_free(wm_sn);
- current_wm_sn_owner = XGetSelectionOwner(ob_display, wm_sn_atom);
+ current_wm_sn_owner = XGetSelectionOwner(obt_display, wm_sn_atom);
if (current_wm_sn_owner == screen_support_win)
current_wm_sn_owner = None;
if (current_wm_sn_owner) {
obt_display_ignore_errors(TRUE);
/* We want to find out when the current selection owner dies */
- XSelectInput(ob_display, current_wm_sn_owner, StructureNotifyMask);
- XSync(ob_display, FALSE);
+ XSelectInput(obt_display, current_wm_sn_owner, StructureNotifyMask);
+ XSync(obt_display, FALSE);
obt_display_ignore_errors(FALSE);
if (obt_display_error_occured)
timestamp = event_get_server_time();
- XSetSelectionOwner(ob_display, wm_sn_atom, screen_support_win,
+ XSetSelectionOwner(obt_display, wm_sn_atom, screen_support_win,
timestamp);
- if (XGetSelectionOwner(ob_display, wm_sn_atom) != screen_support_win) {
+ if (XGetSelectionOwner(obt_display, wm_sn_atom) != screen_support_win) {
g_message(_("Could not acquire window manager selection on screen %d"),
ob_screen);
return FALSE;
const gulong timeout = G_USEC_PER_SEC * 15; /* wait for 15s max */
while (wait < timeout) {
- if (XCheckWindowEvent(ob_display, current_wm_sn_owner,
+ if (XCheckWindowEvent(obt_display, current_wm_sn_owner,
StructureNotifyMask, &event) &&
event.type == DestroyNotify)
break;
}
/* Send client message indicating that we are now the WM */
- prop_message(RootWindow(ob_display, ob_screen), prop_atoms.manager,
+ prop_message(RootWindow(obt_display, ob_screen), prop_atoms.manager,
timestamp, wm_sn_atom, screen_support_win, 0,
SubstructureNotifyMask);
/* create the netwm support window */
attrib.override_redirect = TRUE;
attrib.event_mask = PropertyChangeMask;
- screen_support_win = XCreateWindow(ob_display,
- RootWindow(ob_display, ob_screen),
+ screen_support_win = XCreateWindow(obt_display,
+ RootWindow(obt_display, ob_screen),
-100, -100, 1, 1, 0,
CopyFromParent, InputOutput,
CopyFromParent,
CWEventMask | CWOverrideRedirect,
&attrib);
- XMapWindow(ob_display, screen_support_win);
- XLowerWindow(ob_display, screen_support_win);
+ XMapWindow(obt_display, screen_support_win);
+ XLowerWindow(obt_display, screen_support_win);
if (!replace_wm()) {
- XDestroyWindow(ob_display, screen_support_win);
+ XDestroyWindow(obt_display, screen_support_win);
return FALSE;
}
obt_display_ignore_errors(TRUE);
- XSelectInput(ob_display, RootWindow(ob_display, ob_screen),
+ XSelectInput(obt_display, RootWindow(obt_display, ob_screen),
ROOT_EVENTMASK);
obt_display_ignore_errors(FALSE);
if (obt_display_error_occured) {
g_message(_("A window manager is already running on screen %d"),
ob_screen);
- XDestroyWindow(ob_display, screen_support_win);
+ XDestroyWindow(obt_display, screen_support_win);
return FALSE;
}
/* set the OPENBOX_PID hint */
pid = getpid();
- PROP_SET32(RootWindow(ob_display, ob_screen),
+ PROP_SET32(RootWindow(obt_display, ob_screen),
openbox_pid, cardinal, pid);
/* set supporting window */
- PROP_SET32(RootWindow(ob_display, ob_screen),
+ PROP_SET32(RootWindow(obt_display, ob_screen),
net_supporting_wm_check, window, screen_support_win);
/* set properties on the supporting window */
supported[i++] = prop_atoms.ob_control;
g_assert(i == num_support);
- PROP_SETA32(RootWindow(ob_display, ob_screen),
+ PROP_SETA32(RootWindow(obt_display, ob_screen),
net_supported, atom, supported, num_support);
g_free(supported);
hear it anyways. perhaps it is for old ksplash. or new ksplash. or
something. oh well. */
e.xclient.type = ClientMessage;
- e.xclient.display = ob_display;
- e.xclient.window = RootWindow(ob_display, ob_screen);
+ e.xclient.display = obt_display;
+ e.xclient.window = RootWindow(obt_display, ob_screen);
e.xclient.message_type =
- XInternAtom(ob_display, "_KDE_SPLASH_PROGRESS", False );
+ XInternAtom(obt_display, "_KDE_SPLASH_PROGRESS", False );
e.xclient.format = 8;
strcpy(e.xclient.data.b, "wm started");
- XSendEvent(ob_display, RootWindow(ob_display, ob_screen),
+ XSendEvent(obt_display, RootWindow(obt_display, ob_screen),
False, SubstructureNotifyMask, &e );
}
screen_resize();
/* have names already been set for the desktops? */
- if (PROP_GETSS(RootWindow(ob_display, ob_screen),
+ if (PROP_GETSS(RootWindow(obt_display, ob_screen),
net_desktop_names, utf8, &names))
{
g_strfreev(names);
names[i] = g_strdup(it->data);
/* set the root window property */
- PROP_SETSS(RootWindow(ob_display, ob_screen), net_desktop_names,names);
+ PROP_SETSS(RootWindow(obt_display, ob_screen),
+ net_desktop_names,names);
g_strfreev(names);
}
this will also set the default names from the config file up for
desktops that don't have names yet */
screen_num_desktops = 0;
- if (PROP_GET32(RootWindow(ob_display, ob_screen),
+ if (PROP_GET32(RootWindow(obt_display, ob_screen),
net_number_of_desktops, cardinal, &d))
screen_set_num_desktops(d);
/* restore from session if possible */
screen_desktop = screen_num_desktops; /* something invalid */
/* start on the current desktop when a wm was already running */
- if (PROP_GET32(RootWindow(ob_display, ob_screen),
+ if (PROP_GET32(RootWindow(obt_display, ob_screen),
net_current_desktop, cardinal, &d) &&
d < screen_num_desktops)
{
/* don't start in showing-desktop mode */
screen_showing_desktop = FALSE;
- PROP_SET32(RootWindow(ob_display, ob_screen),
+ PROP_SET32(RootWindow(obt_display, ob_screen),
net_showing_desktop, cardinal, screen_showing_desktop);
if (session_desktop_layout_present &&
if (reconfig)
return;
- XSelectInput(ob_display, RootWindow(ob_display, ob_screen),
+ XSelectInput(obt_display, RootWindow(obt_display, ob_screen),
NoEventMask);
/* we're not running here no more! */
- PROP_ERASE(RootWindow(ob_display, ob_screen), openbox_pid);
+ PROP_ERASE(RootWindow(obt_display, ob_screen), openbox_pid);
/* not without us */
- PROP_ERASE(RootWindow(ob_display, ob_screen), net_supported);
+ PROP_ERASE(RootWindow(obt_display, ob_screen), net_supported);
/* don't keep this mode */
- PROP_ERASE(RootWindow(ob_display, ob_screen), net_showing_desktop);
+ PROP_ERASE(RootWindow(obt_display, ob_screen), net_showing_desktop);
- XDestroyWindow(ob_display, screen_support_win);
+ XDestroyWindow(obt_display, screen_support_win);
g_strfreev(screen_desktop_names);
screen_desktop_names = NULL;
GList *it;
gulong geometry[2];
- w = WidthOfScreen(ScreenOfDisplay(ob_display, ob_screen));
- h = HeightOfScreen(ScreenOfDisplay(ob_display, ob_screen));
+ w = WidthOfScreen(ScreenOfDisplay(obt_display, ob_screen));
+ h = HeightOfScreen(ScreenOfDisplay(obt_display, ob_screen));
if (w == oldw && h == oldh) return;
/* Set the _NET_DESKTOP_GEOMETRY hint */
screen_physical_size.width = geometry[0] = w;
screen_physical_size.height = geometry[1] = h;
- PROP_SETA32(RootWindow(ob_display, ob_screen),
+ PROP_SETA32(RootWindow(obt_display, ob_screen),
net_desktop_geometry, cardinal, geometry, 2);
if (ob_state() == OB_STATE_STARTING)
old = screen_num_desktops;
screen_num_desktops = num;
- PROP_SET32(RootWindow(ob_display, ob_screen),
+ PROP_SET32(RootWindow(obt_display, ob_screen),
net_number_of_desktops, cardinal, num);
/* set the viewport hint */
viewport = g_new0(gulong, num * 2);
- PROP_SETA32(RootWindow(ob_display, ob_screen),
+ PROP_SETA32(RootWindow(obt_display, ob_screen),
net_desktop_viewport, cardinal, viewport, num * 2);
g_free(viewport);
if (previous == num) return;
- PROP_SET32(RootWindow(ob_display, ob_screen),
+ PROP_SET32(RootWindow(obt_display, ob_screen),
net_current_desktop, cardinal, num);
/* This whole thing decides when/how to save the screen_last_desktop so
screen_desktop_layout.rows = 1;
screen_desktop_layout.columns = screen_num_desktops;
- if (PROP_GETA32(RootWindow(ob_display, ob_screen),
+ if (PROP_GETA32(RootWindow(obt_display, ob_screen),
net_desktop_layout, cardinal, &data, &num)) {
if (num == 3 || num == 4) {
g_strfreev(screen_desktop_names);
screen_desktop_names = NULL;
- if (PROP_GETSS(RootWindow(ob_display, ob_screen),
+ if (PROP_GETSS(RootWindow(obt_display, ob_screen),
net_desktop_names, utf8, &screen_desktop_names))
for (i = 0; screen_desktop_names[i] && i < screen_num_desktops; ++i);
else
/* if we changed any names, then set the root property so we can
all agree on the names */
- PROP_SETSS(RootWindow(ob_display, ob_screen), net_desktop_names,
+ PROP_SETSS(RootWindow(obt_display, ob_screen), net_desktop_names,
screen_desktop_names);
}
}
show = !!show; /* make it boolean */
- PROP_SET32(RootWindow(ob_display, ob_screen),
+ PROP_SET32(RootWindow(obt_display, ob_screen),
net_showing_desktop, cardinal, show);
}
{
if (client == NULL || client->colormap == None) {
if (install)
- XInstallColormap(ob_display, RrColormap(ob_rr_inst));
+ XInstallColormap(obt_display, RrColormap(ob_rr_inst));
else
- XUninstallColormap(ob_display, RrColormap(ob_rr_inst));
+ XUninstallColormap(obt_display, RrColormap(ob_rr_inst));
} else {
obt_display_ignore_errors(TRUE);
if (install)
- XInstallColormap(ob_display, client->colormap);
+ XInstallColormap(obt_display, client->colormap);
else
- XUninstallColormap(ob_display, client->colormap);
+ XUninstallColormap(obt_display, client->colormap);
obt_display_ignore_errors(FALSE);
}
}
if (ob_debug_xinerama) {
g_print("Using fake xinerama !\n");
- gint w = WidthOfScreen(ScreenOfDisplay(ob_display, ob_screen));
- gint h = HeightOfScreen(ScreenOfDisplay(ob_display, ob_screen));
+ gint w = WidthOfScreen(ScreenOfDisplay(obt_display, ob_screen));
+ gint h = HeightOfScreen(ScreenOfDisplay(obt_display, ob_screen));
*nxin = 2;
*xin_areas = g_new(Rect, *nxin + 1);
RECT_SET((*xin_areas)[0], 0, 0, w/2, h);
else if (obt_display_extension_xinerama) {
guint i;
gint n;
- XineramaScreenInfo *info = XineramaQueryScreens(ob_display, &n);
+ XineramaScreenInfo *info = XineramaQueryScreens(obt_display, &n);
*nxin = n;
*xin_areas = g_new(Rect, *nxin + 1);
for (i = 0; i < *nxin; ++i)
*nxin = 1;
*xin_areas = g_new(Rect, *nxin + 1);
RECT_SET((*xin_areas)[0], 0, 0,
- WidthOfScreen(ScreenOfDisplay(ob_display, ob_screen)),
- HeightOfScreen(ScreenOfDisplay(ob_display, ob_screen)));
+ WidthOfScreen(ScreenOfDisplay(obt_display, ob_screen)),
+ HeightOfScreen(ScreenOfDisplay(obt_display, ob_screen)));
}
/* returns one extra with the total area in it */
/* all the work areas are not used here, only the ones for the first
monitor are */
- PROP_SETA32(RootWindow(ob_display, ob_screen), net_workarea, cardinal,
+ PROP_SETA32(RootWindow(obt_display, ob_screen), net_workarea, cardinal,
dims, 4 * screen_num_desktops);
/* the area has changed, adjust all the windows if they need it */
void screen_set_root_cursor(void)
{
if (sn_app_starting())
- XDefineCursor(ob_display, RootWindow(ob_display, ob_screen),
+ XDefineCursor(obt_display, RootWindow(obt_display, ob_screen),
ob_cursor(OB_CURSOR_BUSYPOINTER));
else
- XDefineCursor(ob_display, RootWindow(ob_display, ob_screen),
+ XDefineCursor(obt_display, RootWindow(obt_display, ob_screen),
ob_cursor(OB_CURSOR_POINTER));
}
guint u;
gboolean ret;
- ret = !!XQueryPointer(ob_display, RootWindow(ob_display, ob_screen),
+ ret = !!XQueryPointer(obt_display, RootWindow(obt_display, ob_screen),
&w, &w, x, y, &i, &i, &u);
if (!ret) {
- for (i = 0; i < ScreenCount(ob_display); ++i)
+ for (i = 0; i < ScreenCount(obt_display); ++i)
if (i != ob_screen)
- if (XQueryPointer(ob_display, RootWindow(ob_display, i),
+ if (XQueryPointer(obt_display, RootWindow(obt_display, i),
&w, &w, x, y, &i, &i, &u))
break;
}