DaemonForums  

Go Back   DaemonForums > Miscellaneous > General software and network

General software and network General OS-independent software and network questions, X11, MTA, routing, etc.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 22nd September 2016
fvgit's Avatar
fvgit fvgit is offline
Spikes in tights
 
Join Date: May 2016
Location: perl -MMIME::Base64 -le 'print decode_base64("U2hlcndvb2QgRm9yZXN0")'
Posts: 314
Default Xconsole: is it possible to open a second window?

As the title says. When I try to, it just re-spawns the existing xconsole window. This seems to be by design (same behaviour observed in OpenBSD & Mac OS X.) Either that, or I'm doing it wrong?
Reply With Quote
  #2   (View Single Post)  
Old 23rd September 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

This is by design, to my understanding. The old window is deleted and replaced with the new, beginning at line 673 in xenocara/app/xconsole/xconsole.c.

The OpenBSD implementation adds privilege separation to the xconsole application -- you will note there are two running processes -- however the single window (and single instance of xconsole use) is from the upstream design, as this same code can be found in the upstream source code.
Reply With Quote
  #3   (View Single Post)  
Old 24th September 2016
fvgit's Avatar
fvgit fvgit is offline
Spikes in tights
 
Join Date: May 2016
Location: perl -MMIME::Base64 -le 'print decode_base64("U2hlcndvb2QgRm9yZXN0")'
Posts: 314
Default

Thanks for clearing that up. It was driving me nuts not knowing whether I was at fault or not. And I do have to admit, I'm not that good at code reading myself. I'd probably have searched for sth. like 'close' and then given up after a cursory glance without being any wiser...
Reply With Quote
  #4   (View Single Post)  
Old 25th September 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

If you'd like to watch as the code functions, which is often easier than reading the source directly, you can step through the code line by line with gdb(1).

For applications included with X, which use the OpenBSD-specific "Xenocara" build framework, you first need to obtain the source code, then create the object file structures. You don't need to build all of X.

Guidance for obtaining the Xenocara source, and for creating the object directories can be found in the release(8) man page. If you are running -release, you can download and unpack xenocara.tar.gz from your nearby mirror. Source code for -stable or -current require the use of cvs(1).

For clarity, after placing source in /usr/xenocara/:
Code:
# cd /usr/xenocara
# make bootstrap
# make obj
/usr/xenocara/README has guidance for building Xenocara source code with debugging symbols. To build xconsole:
Code:
# cd /usr/xenocara/app/xconsole
# rm /usr/xobj/xorg-config.cache.$(machine)
# env CFLAGS=-g make -f Makefile.bsd-wrapper build
And then you can load the unstripped binary in gdb(1) and step through the code starting with its main() function. For ease of use, after issuing the gdb step command, you can press the Enter key alone to proceed line by line.
Code:
# gdb -q obj/xconsole
(gdb) b main
Breakpoint 1 at 0x1706: file /usr/xenocara/app/xconsole/xconsole.c, line 625.
(gdb) r
Starting program: /usr/xobj/app/xconsole/xconsole 
Breakpoint 1 at 0x5138ab01706: file /usr/xenocara/app/xconsole/xconsole.c, line 625.

Breakpoint 1, main (argc=1, argv=0x7f7ffffcdaa8) at /usr/xenocara/app/xconsole/xconsole.c:625
625     {
(gdb) step
632         XtSetLanguageProc(NULL,NULL,NULL);
(gdb)  
633         top = XtInitialize ("xconsole", "XConsole", options, XtNumber (options),
(gdb) 
635         XtGetApplicationResources (top, (XtPointer)&app_resources, resources,
(gdb) 
640         if (getuid() == 0) {
.
.
.

Last edited by jggimi; 25th September 2016 at 12:29 AM. Reason: two typos, added a comment about the -release tarball
Reply With Quote
  #5   (View Single Post)  
Old 25th September 2016
fvgit's Avatar
fvgit fvgit is offline
Spikes in tights
 
Join Date: May 2016
Location: perl -MMIME::Base64 -le 'print decode_base64("U2hlcndvb2QgRm9yZXN0")'
Posts: 314
Default

Wow, nice tutorial. I'll have to save that for future reference, really cool.
Reply With Quote
  #6   (View Single Post)  
Old 25th September 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

How do you think I found the window deletion?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
X-window to sparc64 philo_neo71 OpenBSD Packages and Ports 4 26th October 2014 01:32 AM
what's your favorite window manager ? and why ? daemonfowl Off-Topic 2 21st February 2012 12:16 AM
X window on KDE background? maxrussell FreeBSD General 14 13th October 2011 06:50 PM
window manager troubles techmarks FreeBSD General 3 29th September 2008 10:19 PM
IPF: Packets Out Of Window bram85 FreeBSD Security 9 2nd June 2008 04:09 PM


All times are GMT. The time now is 10:01 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick