Re: Remote OpenGL -- getting it to work?

2016-05-31 Thread Glynn Clements

L. A. Walsh wrote:

> I have sometimes gotten some GLX programs to work for a short while,
> but more often than not, I don't get them to work at all.

The most likely reason for this is that the program needs a later
version of OpenGL than Cygwin's X server provides.

> I'm not sure where to look for how to configure it to be allowed,

No configuration is required.

> but on the client end, it doesn't seem to ever want to load swrast.

swrast isn't relevant for indirect rendering. The fact that libGL even
attempts to load it when $DISPLAY refers to a remote server is less
than desirable, but ultimately doesn't matter.

-- 
Glynn Clements <gl...@gclements.plus.com>
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: https://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s

Re: Strange results from xdpyinfo

2016-04-26 Thread Glynn Clements

David C. Partridge wrote:

> Specifically there are multiple (many, many) results looking like:

If you run "glxinfo", you'll find that they differ in terms of their
GLX-specific properties (single-buffered or double-buffered, whether
they have an accumulation buffer, and the number of samples for MSAA).

> this is blowing the buffer for an application that uses xdpyinfo to
> determine the display resolution to use.

> Is there any fix for this problem?

Use a larger (i.e. dynamically-allocated) buffer, or avoid making a
copy (XGetVisualInfo() dynamically allocates the memory for the table
and returns a pointer to it).

-- 
Glynn Clements <gl...@gclements.plus.com>
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: https://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s

Re: Strange issue with fglrx/opengl

2015-03-16 Thread Glynn Clements

Dwayne Rightler wrote:

 This one is puzzling me... any help would be great!
 
 glxinfo/glxgears does not work from my user account:
 
 darkomen@darkomen-desktop:~$ glxinfo
 name of display: :0
 Error: couldn't find RGB GLX visual or fbconfig
 
 darkomen@darkomen-desktop:~$ glxgears
 Error: couldn't get an RGB, Double-buffered visual
 
 
 If I give local permissions and su to root it works as root:

 root@darkomen-desktop:~# glxinfo
 name of display: :0
 display: :0  screen: 0
 direct rendering: No (If you want to find out why, try setting
 LIBGL_DEBUG=verbose)

 If I ssh into localhost as my normal user with X11 Forwarding it works:

 darkomen@darkomen-desktop:~$ glxinfo
 name of display: localhost:11.0
 display: localhost:11  screen: 0
 direct rendering: No (If you want to find out why, try setting
 LIBGL_DEBUG=verbose)

For another data point, try

export LIBGL_ALWAYS_INDIRECT=1

before running the glxinfo command.

It's possible that there's an issue which only affects direct
rendering. ssh -X localhost would prevent that (although I don't know
why running as root would; perhaps the issue is something in your
environment which is fixed by su - ... rather than by running as
root per se).

-- 
Glynn Clements gl...@gclements.plus.com
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s

Re: XPutImage() Seg Fault

2015-01-27 Thread Glynn Clements

Richard Overstreet wrote:

  displaydata = (unsigned char *)calloc(ROWS*COLS*2, sizeof(unsigned char));
 
  
  
 Picture=XCreateImage(Monitor,DefaultVisual(Monitor,0),
 DefaultDepth(Monitor,0),

Is the display depth actually 16 bpp? If it's 32 bpp, the XPutImage
call will try to copy twice as much data as you've allocated, which
may well result in a segfault.

-- 
Glynn Clements gl...@gclements.plus.com
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s

Re: Graphics speed depends on user profile

2014-11-20 Thread Glynn Clements

Juan Pablo de la Cruz wrote:

 We have an library which directly uses the Xlib API to do graphics.
 
 We are observing the following effect: when two different users log
 in the same machine, use the same window manager, and run the very same
 program, the graphics are slower (much) for one of the users.
 
 Concretely, the user for which the drawing is slower, logs himself in,
 and the other user executes su $USER on the terminal.
 
 Both use the exact same libraries (same PATH and LD_LIBRARY_PATH).
 Both use the same window manager.
 
 What other settings/factors could explain this behaviour?

What are their $DISPLAY settings?

If $DISPLAY is :0 then the client will connect to the X server via
the Unix-domain socket at /tmp/.X11-unix/X0. Whereas if $DISPLAY is
localhost:0, it will connect to the X server via TCP port 6000.

The latter will result in the data stream being chopped up into
packets and passed through the kernel's TCP/IP stack: routing,
firewall rules, etc.

It may also prevent the use of features such as direct rendering, as
the client and server are likely to be deemed to reside on different
systems.

-- 
Glynn Clements gl...@gclements.plus.com
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s

Re: CVE-1999-0526 Vulnerbility on W2k8 R2

2014-09-23 Thread Glynn Clements

Duane Fish wrote:

 I see nothing in the Add/Remove (or what was once called that), Programs, 
 etc.  

[What follows works for me on a Windows 7 system; the details may be
different on your system, but hopefully shouldn't be too different.]

Start a command prompt as administrator, and use the command

netstat -a -n -p tcp -o

That should produce a listing of active connections; you're looking
for an entry like:

  TCP0.0.0.0:6000   0.0.0.0:0  LISTENING   2104

I.e, a TCP socket in the LISTENING state on port 6000 (or possibly a
different value in the range 6000-6010).

The last number (2104 in this case) is the process identifier (PID).

If you don't see such an entry, no X server is running at present.

One may have been bundled as part of another application, and[1] is
started by that application.

[1] Typically, an application which was originally developed for Unix
and has been ported to Windows rather than being re-written; if you
have any applications which don't feel much like Windows
applications, these would be prime suspects.

Start the Task Manager (e.g. Control-Shift-Escape), switch to the
Processes tab, and use the View - Select Columns ... menu option to
add a display column for the PID. Look for the process with the
matching PID. Right click on the entry and choose Open File Location
from the menu. This should allow you to determine the filename of the
executable and the directory which contains it. Hopefully that should
provide some clues as to the source, or at least something to google
for.

Alternatively, you may find TCPView simpler:

http://technet.microsoft.com/en-us/sysinternals/bb897437.aspx

-- 
Glynn Clements gl...@gclements.plus.com
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s


Re: xmodmap 1.0.7: left shift + right shift + comma keys

2014-03-15 Thread Glynn Clements

YuGiOhJCJ Mailing-List wrote:

 Yes, my keyboard is very cheap and it could explain why it does not
 handle these combinations.

Nearly all keyboards will have exactly the same issue.

IME, it's only keyboards which are specifically marketed for gaming
which have a diode for each key. For gaming, it's common for keys to
be held rather than pressed momentarily. Coupled with a desire to
allow the key assignments to be customised, this makes phantom keys
far more of an issue than for normal use (i.e. typing).

-- 
Glynn Clements gl...@gclements.plus.com
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s


Re: xmodmap 1.0.7: left shift + right shift + comma keys

2014-03-13 Thread Glynn Clements
 the rows to the columns, and not
vice-versa. But that adds to the cost, and most modern keybards are
nothing if not cheap.

-- 
Glynn Clements gl...@gclements.plus.com
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s


Re: resetting server without loosing clients?

2014-02-21 Thread Glynn Clements

Steven Feil wrote:

 Is there a way to reset/restart the Xorg server without killing the
 programs that are clients of the server? 

No.

 Or possibily, is
 there some a way will keep the clients alive (similar to nohup) and
 allow me to reattach them to the server once it is restarted?

You could use VNC, i.e. have the clients connect to Xvnc and have the
real X server run the VNC viewer (in full-screen mode) as its sole
client.

The main downside is performance, as Xvnc uses software rendering and
cannot take delegate rendering to the video hardware.

-- 
Glynn Clements gl...@gclements.plus.com
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s


Re: Choosing fonts and sizes

2013-10-29 Thread Glynn Clements

Steven Feil wrote:

 I have also noticed that the problem is based on the computer it is
 being displayed on and not the computer that XEmacs is being run
 on. If I run XEmacs on the new computer I get the wrong font when
 displaying it on the new computer. However If I run XEmacs on the new
 computer but export the display to the old computer, I see it in the
 right font. If I export the display the other way around where it is
 displaying on the new computer, I get the wrong font again.

My guess is that the font size is specified in points, and the
displays have different physical resolutions (dpi), resulting in
different font sizes in pixels.

If that's the case, you can either specify the font size in pixels (at
least, you can if you use X resources; I don't know about the
customize interface), or force the new display to the same dpi as the
old one via the -dpi option.

-- 
Glynn Clements gl...@gclements.plus.com
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s


Re: XRandR transform (keystone correction) not working as I would expect

2013-10-02 Thread Glynn Clements

AJ Heller wrote:

 I implemented a transformation matrix to pinch the top of my screen 100px
 on each side. My hope is for the resulting image to be an isosceles
 trapezoid (trapezium) with the smaller base on top, larger base on bottom
 filling the width of the screen, and with no part of the image missing or
 drawn off the screen.
 
 After transforming, the top remains fixed at the width of the screen, and
 the bottom of the trapezoidal image is drawn off the screen on either side.
 I could be confused about what the transform should be doing, but otherwise
 I think this is a bug.
 
 Have I setup my transformation incorrectly? Should I file a bug report?

 I'm working with 1440x900 resolution. I mapped the four corners to my
 desired output coordinates:
 
 (0,0) = (0,0)
 (1440,0) = (1440,0)
 (0,900) = (100,900)
 (1440,900) = (1340,900)

 My transformation matrix is:
 1, 0.30769, 0
 0, 1.38462, 0
 0, 0.00043, 1

Based upon the xrandr manual page and your pictures, that's not what
you want, and will produce the results you describe.

First, the transformation converts from output coordinates to input
coordinates. So the above will result in the bottom corners of the
screen being mapped 100 pixels in from the edge (i.e. you'll lose 100
pixels at each side). Except, it's actually 200 pixels for the matrix
which you give.

Second, 0,0 is the top-left corner, not the bottom-left (this isn't
stated in the manual page, but it explains why the the oversized edge
is the bottom edge rather than the top edge).

If I'm understanding you (and xrandr) correctly, the matrix you want
is:

1.16129, 0.12903, -116.12903
0. , 1.16129,0. 
0. , 0.00018,1. 

This will map:

 outputinput

 100,   0   0,   0
1340,   01440,   0
   0, 900   0, 900
1440, 9001440, 900

-- 
Glynn Clements gl...@gclements.plus.com
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: arch...@mail-archive.com


Re: need help with freetype + xlib.

2013-06-18 Thread Glynn Clements

First Last wrote:

 Hi, I try to use freetype with xlib, I , I need to pass a char type
 array (RGBA/pixel) to a xlib function.
 
 from freetype I got :
 
   face-glyph-bitmap.pixel_mode = 2
 so if I understood corectly in face-glyph-bitmap.buffer datas are stored in 
 gray level.
   face-glyph-bitmap.rows=16
   face-glyph-bitmap.width=8
   face-glyph-bitmap.pitch=8
 
 so I guess,  length of face-glyph-bitmap.buffer = 
 1(gray lvl)*16(width)*8(rows)=128 unsigned chars, right ?

Right answer, wrong reasoning; width should be replaced by pitch. The
two values may differ if there is padding between lines.

 then I create an array of char for xlib from face-glyph-bitmap.buffer
 
   for(i=0;i128;i++){    
     Xdata[4*i] = face-glyph-bitmap.buffer[i];
     Xdata[4*i+1] = face-glyph-bitmap.buffer[i];
     Xdata[4*i+2] = face-glyph-bitmap.buffer[i];
     Xdata[4*i+3] = 255;    
    }   
 and I try to create a XImage :
   ximage = XCreateImage(display, DefaultVisual(display,0), 24, ZPixmap, 0,    
                        
     Xdata[0], 8/*rows*/, 16/*width*/, 
 32/*RGBA*/, 8/*pitch??*/);


The last argument (bytes_per_line) should be 32 (8 pixels wide at 4
bytes per pixel).

-- 
Glynn Clements gl...@gclements.plus.com
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: arch...@mail-archive.com


Re: redraw, who (xlib/cairo), when...

2013-05-29 Thread Glynn Clements

First Last wrote:

      while(XPending(dpy)==0){
      usleep(100);
      updateClock(myClock);
  
 
  Ugh. This causes the process to be scheduled up to 10,000 times per
  second, which is almost a busy wait. I would expect this process to
  consume far more CPU than is necessary.
 
 do you mix up with nanosleep()(http://linux.die.net/man/3/usleep)? 

No.

 so, if I right, I have settled the sleep time at 0.1s

The argument to usleep() is in microseconds. 100 microseconds is
1/10th of a millisecond or 1/1th of a second.

-- 
Glynn Clements gl...@gclements.plus.com
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: arch...@mail-archive.com


Re: redraw, who (xlib/cairo), when...

2013-05-28 Thread Glynn Clements

First Last wrote:

 after some reads and looking at the event.c from jwm, my clock works!
 I'm using a structure like this :

     while(XPending(dpy)==0){
     usleep(100);
     updateClock(myClock);
 

Ugh. This causes the process to be scheduled up to 10,000 times per
second, which is almost a busy wait. I would expect this process to
consume far more CPU than is necessary.

It would be significantly more efficient to use select() or poll() on
the connection to the X server so that the process is only scheduled
when there is something for it to do. Or failing that, at least
increase the sleep interval substantially.

-- 
Glynn Clements gl...@gclements.plus.com
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: arch...@mail-archive.com


Re: redraw, who (xlib/cairo), when...

2013-05-26 Thread Glynn Clements

First Last wrote:

 So now my problem, I need to redraw the clock, that actualy doesn't
 working yet, since I 'm bit lost with when and how to redraw, if
 it's cairoor xlibwho has (or both) to redraw etc.

You should redraw the window (or at least the rectangle specified in
the XExposeEvent structure) in response to an Expose event. Ideally,
you should collect any pending Expose events and perform the minimum
amount of work necessary to redraw the specified rectangles (i.e. if
there are multiple pending Expose events covering the entire window,
you should only redraw it once, not once per event).

 Moreover, there is something I don't understand more, when I hit
 space, then the window moves and there is a redraw (you can see it
 when the minutes change).

Your main loop calls XNextEvent(), which will block until an event is
available. If there are no events to report, it will block
indefinitely.

If you want the application to perform a task (e.g. update the
display) at regular intervals, you need to use e.g. XEventsQueued() or
XCheckMaskEvent() to query for events without blocking.

If no events are available, use XInternalConnectionNumbers() to get a
list of the relevant descriptors (those for the connection to the X
server plus associated processes such as input method servers) then
use select() or poll() with a timeout to wait until input is available
or the timeout expires.

Beyond that, I suggest looking at the source code for the main loop of
an existing GUI toolkit for clues as to how to implement input, timer
and/or idle events.

-- 
Glynn Clements gl...@gclements.plus.com
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: arch...@mail-archive.com


Re: Trying to figure out how to render a single character represented by a FT_Bitmap in X

2013-02-16 Thread Glynn Clements

joe M wrote:

 I am trying to figure how to print one character from a FT_Bitmap
 (freetype2 bitmap).
 
 But, I am not able to get the character to display properly. I seem to
 be missing something simple.
 
 I seem to be missing something simple while creating the X pixmap
 based on the FT_Bitmap.buffer.
 
 Any thoughts, please?

   error = FT_Load_Char( face, 'z', FT_LOAD_RENDER );

This calls FT_Render_Glyph with a mode of FT_RENDER_MODE_NORMAL, which
generates an 8-bpp antialiased image, whereas ...

  p = XCreateBitmapFromData(d, w,
slot-bitmap.buffer, slot-bitmap.width ,
  slot-bitmap.rows);

... this expects a 1-bpp monochrome bitmap. Pass FT_LOAD_MONOCHROME to
FT_Load_Char to get a monochrome bitmap instead of a grey-scale image.

Also: you're ignoring the bitmap's pitch (slot-bitmap.pitch). The
bitmap created by FT_Load_Char isn't guaranteed to be packed, but
XCreateBitmapFromData() requires it to be. Also, the data in
slot-bitmap.buffer can be top-to-bottom (positive pitch) or
bottom-to-top (negative pitch), but XCreateBitmapFromData() only
supports the former.

You can get more flexibility by creating an XImage from the data then
drawing the XImage into a Pixmap. Or you could just convert the data
manually.

  
 XWriteBitmapFile(d,test1.bmp,p,slot-bitmap.width,slot-bitmap.rows,0,0);

The .bmp extension is normally used for Microsoft Windows bitmap
(BMP) files. XWriteBitmapFile() generates an X bitmap (XBM) file,
which normally has either a .xbm extension or no extension (see the
files in /usr/include/X11/bitmaps).

-- 
Glynn Clements gl...@gclements.plus.com
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: arch...@mail-archive.com


Re: WM_CLASS purpose?

2012-10-29 Thread Glynn Clements

Vladimir A. Pavlov wrote:

 I'm working on a window manager and I got a few
 questions concerning WM_CLASS property.
 
 The questions are:
 
 1. What is WM_CLASS's purpose? I thought it's to find
    X resources set by xrdb but Xrm* functions doesn't
    seem to depend on it. Is there any specific purpose,
    or does WM_CLASS have no specific purpose and just
    stores the info that other apps/users decide on how to use it?

The application class is more general than the name. E.g. a user may
run multiple instances of an application with different names, but
they will normally all have the same class.

The class is used for locating resource files (and other files located
via via XtResolvePathname), and for specifying most resources in e.g. 
~/.Xdefaults. You can provide custom resource settings for specific
instances by using the name in the resource setting instead of the
class.

The WM_NAME and WM_CLASS properties make this information available to
other clients, e.g. the window manager and editres. The application
will set these properties to the same values which it passes to Xt.

 2. Are there rules (recommendation) that an application should
follow when setting res_name and res_class?

Normally, the class is hard-coded while the name will be set to the
base name of the executable (determined from argv[0]). These can
normally be overridden with the -class and -name switches.

    For example, let's suppose I have a window manager
    somebox that has taskbar, dock, menus for starting
    applications/switching workspaces and configuration dialogs.
    What should be res_name/res_class for each of them?

An X client should have a single name and class. You shouldn't use
different values for different windows within a single client
(however, it's possible for a single process to contain multiple
clients by calling XtOpenApplication() multiple times; each client
has a separate X connection and XtAppContext).

-- 
Glynn Clements gl...@gclements.plus.com
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: arch...@mail-archive.com


Re: newbie resource temporarily unavailable

2012-07-01 Thread Glynn Clements

pk wrote:

  FYI
  perhaps this is correct for desktop but there are several applications
  in the wild that are used regular that require Xt.

That's the difference between legacy and obsolete. Legacy software
still has some value due to historical (i.e. compatibility) reasons,
but wouldn't normally be considered if you were starting from a blank
slate. If absolutely nothing used it, it would be obsolete.

 Besides XEmacs, regular Emacs (with X support), Gnu gv, Libreoffice,
 Sun/Oracle JDK (with X support), tk, Thunderbird, Imagemagick (with X
 support), Firefox, Seamonkey, Xscreensaver, Xterm amongst others all
 depends on Xt acc. to my 'equery depends x11-libs/libXt' on my Gentoo
 machine (not sure if all is runtime dependencies though). So it seems Xt
 is far from dead?

Firefox only uses Xt because it's specified by the Netscape plug-in
API, which dates back to when Netscape Navigator used Motif. It was
re-written using GTK shortly after it became Free software due to
Motif being non-Free and the free alternative (Lesstif) being
insufficiently robust.

Tk isn't linked against libXt, but it might need some files which are
part of the libXt package (Tk uses X resources, but does so by
manually parsing ~/.Xdefaults etc; it doesn't even use the Xrm*
functions from Xlib).

The ImageMagick libraries are linked against libXt, but don't appear
to use any symbols from it. It uses libdl, so it's possible that, like
Firefox, there are third-party plug-ins which depend upon Xt.

Many others are themselves bordering on legacy status (e.g. Gnome and
KDE each have their own terminal emulators).

-- 
Glynn Clements gl...@gclements.plus.com
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: arch...@mail-archive.com


Re: newbie �resource temporarily unavailable� questi on

2012-06-29 Thread Glynn Clements

Alan Corey wrote:

 I'm just plinking around after having read the early chapters of the
 O'Reilly volumes 4a and 6a plus some Athena and Xlib stuff. I was
 itching to try some things.  For my background see
 http://ab1jx.webs.com  For graphics programming I've mostly worked in
 Turbo Pascal and Delphi.

Okay, so you've progressed from the 1980's to the 1990's ;)

I wouldn't advise putting too much effort into Xt/Xaw stuff; they've
fallen so far into disuse that if X.org shipped a totally
non-functional version of one of those libraries, it might take a year
before anyone actually noticed.

And Xlib itself is slowly heading the same way; XRender and OpenGL are
frequently preferred for the graphics side.

OTOH, a basic understanding of the principles underlying X is never a
bad thing to have.

 when I try
 to use XCopyPlane to copy to the Panner I get the unavailable message.
  I can use XDrawSegments directly on the Panner (well, once anyway),
 copy the grid into another Pixmap with XCopyPlane, most other things
 seem to work.Aside from the unavailable message I get a black
 rectangle where the Pixmap should be.  Nothing shows up in
 /var/log/Xorg.0.log about it, and it's not fatal: I can keep running
 the program.  I wouldn't have known it was there except I put a perror
 after the XCopyPlane to investigate the black Pixmap.

I think that you may be chasing a phantom here.

Once something sets errno, it usually stays set until something
explicitly clears it. errno should only be considered meaningful in
the event that a function returns an error status (most Xlib functions
don't) and the function's documentation states that errno will be set
in this situation.

This is particularly applicable to resource temporarily unavailable,
which is the message for the EAGAIN code. This often just means that a
non-blocking operation (such as read() or write() on a non-blocking
descriptor) cannot produce any data available right now (read() cannot
return 0 in this situation because that indicates EOF).

IOW, it's not an error; in fact, I wouldn't be surprised if
practically every Xlib call could set errno to EAGAIN even when the
call completes successfully.

As for your black rectangle, you'll need to look elsewhere. Are you
copying the correct plane? Are the foreground and background colours
of the GC set correctly? If you used an XColor to determine the
numeric value for the colours, don't forget that XColour uses 16-bit
values (0..65535) for the components; if you use 8-bit values
(0..255), you can have any colour you like so long as it's black.

-- 
Glynn Clements gl...@gclements.plus.com
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: arch...@mail-archive.com


Re: XSetBackgroundPixmap question

2012-05-19 Thread Glynn Clements

[I presume that you mean XSetWindowBackgroundPixmap; there is no Xlib
function named XSetBackgroundPixmap.]

James Buren wrote:

 When using this Xlib function to set a new background pixmap, how does the 
 old one get
 freed? If I am setting the root window's background pixmap, I don't know how 
 I can get the
 XID of the old one. If it is a window I created, I can cache it but that 
 seems overkill if I'm
 just wanting to discard the old one. Can someone direct me to how I am 
 supposed to free
 the old background pixmap? Thanks.

The manual page for XSetWindowBackgroundPixmap says:

The XSetWindowBackgroundPixmap function sets the background
pixmap of the window to the specified pixmap. The background
pixmap can immediately be freed if no further explicit
references to it are to be made.

That seems to imply that the X server makes a copy of the pixmap data
rather than keeping a reference to the original pixmap. However, I
don't believe that's how the X.org server actually implements it.

I've encountered code which uses a background pixmap to implement a
persistent screen, and drawing to the pixmap then calling XClearWindow
(without calling XSetWindowBackgroundPixmap in between) results in the
updated pixmap contents appearing in the window. So it appears to use
reference counting or similar.

The combination of the documentation and the observed behaviour
implies that the X server *may* copy the pixmap data or it may just
keep a reference. Either way, deleting the pixmap after setting it
should be fine, but modifying a pixmap which has been used as a
background pixmap has undefined behaviour.

Regardless of the implementation, there isn't any way to query the
current background pixmap. The background_pixmap field in the
XSetWindowAttributes structure used by XChangeWindowAttributes isn't
present in the XWindowAttributes structure used by XGetWindowAttributes.

-- 
Glynn Clements gl...@gclements.plus.com
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: arch...@mail-archive.com


Re: x forwarding? Fixed?

2012-03-15 Thread Glynn Clements

gene heskett wrote:

  In my experience, enabling debugging on the server side (via the
  LogLevel directive in sshd_config) tends to be more useful than
  the debug information produced by the client.
 
 In this case 'server' I assume being the machine I am targeting, aka 
 'lathe'?

Yes; the machine running the sshd daemon.

The ssh client can only tell you what the ssh server tells it, and
it's in the nature of the secure shell protocol for the server not
to tell the client too much. It may tell it if something failed, but
probably not exactly how or why it failed.

-- 
Glynn Clements gl...@gclements.plus.com
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: arch...@mail-archive.com