Getting info from existing X clients...

This is a discussion on Getting info from existing X clients... within the Linux Programming forums, part of the Platform Specific Boards category; I'm trying to figure out if an application that is running is running fullscreen. By querying the application with xwininfo ...

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    62

    Getting info from existing X clients...

    I'm trying to figure out if an application that is running is running fullscreen.
    By querying the application with xwininfo I get this
    Code:
    xwininfo: Window id: 0x300000e "PlanetPenguin Racer 0.3.1"
    
      Absolute upper-left X:  6
      Absolute upper-left Y:  48
      Relative upper-left X:  6
      Relative upper-left Y:  25
      Width: 800
      Height: 600
      Depth: 24
      Visual Class: DirectColor
      Border width: 0
      Class: InputOutput
      Colormap: 0x300000c (installed)
      Bit Gravity State: ForgetGravity
      Window Gravity State: NorthWestGravity
      Backing Store State: NotUseful
      Save Under State: no
      Map State: IsViewable
      Override Redirect State: no
      Corners:  +6+48  -218+48  -218-120  +6-120
      -geometry 800x600+0+23
    This doesn't give me much to go by as my current resolution is 1024x768. Please note that even though this is a fullscreen app running at 800x600 - xdpyinfo and xrandr both report the screen res at 1024x768

    I then run xprop on the same app:
    Code:
    WM_ICON_NAME(UTF8_STRING) = "PlanetPenguin Racer 0.3.1"
    WM_NAME(UTF8_STRING) = "PlanetPenguin Racer 0.3.1"
    _NET_WM_ICON_GEOMETRY(CARDINAL) = 555, 741, 26, 27
    XKLAVIER_STATE(INTEGER) = 0, 3
    _NET_WM_STATE(ATOM) = 
    WM_STATE(WM_STATE):
    		window state: Normal
    		icon window: 0x0
    _NET_FRAME_EXTENTS(CARDINAL) = 6, 6, 25, 6
    _NET_WM_DESKTOP(CARDINAL) = 0
    _NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_MOVE, _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_SHADE, _NET_WM_ACTION_CHANGE_DESKTOP, _NET_WM_ACTION_CLOSE
    WM_NORMAL_HINTS(WM_SIZE_HINTS):
    		user specified location: 0, 0
    		program specified minimum size: 800 by 600
    		program specified maximum size: 800 by 600
    WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW
    WM_CLASS(STRING) = "SDL_App", "SDL_App"
    WM_HINTS(WM_HINTS):
    		Client accepts input or input focus: True
    So from what I can see all I get from this is that it has focus, but what I don't get is any indication that it is fullscreen...ie
    _NET_WM_STATE_FULLSCREEN

    Can anybody help me with this task? Perhaps you know what some of these other info's are and they mean it is fullscreen.

    Thanks in advance.
    Last edited by 3saul; 02-23-2006 at 05:19 PM.

  2. #2
    xhi
    xhi is offline
    !anExpert
    Join Date
    Mar 2005
    Location
    pa
    Posts
    155
    it looks like you are using sdl? if so this will work..
    Code:
    if(s->flags ^ SDL_FULLSCREEN) cout << "fullscreen" << endl;
    else cout << "not fullscreen" << endl;
    where s is your main SDL_Surface.. it probably works on any surface but i have never tried it..

    hth

  3. #3
    Registered User
    Join Date
    Jan 2006
    Posts
    62
    Quote Originally Posted by xhi
    it looks like you are using sdl? if so this will work..
    Code:
    if(s->flags ^ SDL_FULLSCREEN) cout << "fullscreen" << endl;
    else cout << "not fullscreen" << endl;
    where s is your main SDL_Surface.. it probably works on any surface but i have never tried it..

    hth

    Yes this will be useful....but only for apps that use SDL. I need to be able to figure out if any app, be it Doom or an SDL app is fullscreen.

  4. #4
    xhi
    xhi is offline
    !anExpert
    Join Date
    Mar 2005
    Location
    pa
    Posts
    155
    yeh. sdl, thats what i said.

    >WM_CLASS(STRING) = "SDL_App", "SDL_App"
    is why i gave that example..

    i misunderstood. i though you were trying to detect from inside the program itself..

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help displaying info from structure
    By kisiellll in forum C Programming
    Replies: 6
    Last Post: 04-04-2009, 01:51 PM
  2. Getting a ancestor to save derived class info
    By Emeighty in forum C++ Programming
    Replies: 6
    Last Post: 02-01-2009, 12:55 AM
  3. Question about getting an info class from another Form
    By Joelito in forum C# Programming
    Replies: 0
    Last Post: 10-16-2006, 02:02 PM
  4. Socket Help - Multiple Clients
    By project95talon in forum C Programming
    Replies: 5
    Last Post: 11-17-2005, 02:51 AM
  5. Help doing an e-mail program in c...
    By Tyler_Durden in forum C Programming
    Replies: 88
    Last Post: 01-02-2005, 03:12 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21