Find the answer to your Linux question:
Results 1 to 6 of 6
Hello Everyone, I have been contemplating a problem of linux-Xwindows, and most other graphical operating systems, that windows on small screens often go off of one side, and are not ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2009
    Posts
    22

    gtk+ with window scaling based on dpi instead of pixels


    Hello Everyone, I have been contemplating a problem of linux-Xwindows, and most other graphical operating systems, that windows on small screens often go off of one side, and are not resizeable to any smaller than a particular minimum pixel size. On small pixil count screens, I would often rather have the window size based on percent of screen real estae, or even physical size rather than pixel count. This would seem like a reasonably simple thing to do given that only a simple scaling algorithm would have to be put in the program that actually draws the program, or the program. I use gnome or xfce with GTK+ and really like the way that looks. I have been wondering what part of GTK actually does the drawing of the windows, and were, if even possible, to start adding code to allow scaling. I would also like to mix this with something like the zooming effect from a high virtual resolution that would allow a user to dynamically zoom in and out on scaled down windows. This would be useful for netbook users as well as in running full linux on a phone. If anyone knows of a solution to this problem, or any information as to where to start, I would be very happy. I would be glad to make this an official project and welcome any help or support. I am a programmer, but not a very experienced one. Thank you in advance

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    11,159
    Suggestion: download the GTK+ source code and look at that. It should not be too difficult to determine where this is happening. One suggestion would be to build the GTK+ libraries and your application as debuggable, and step into the window drawing functions until you find what you need. Alternatively, you can use a modeling tool like Enterprise Architect to reverse-engineer the code to UML models, or finally just do an eyeball mark one analysis of the code. Or some lurker here who is familiar with GTK+ code might know...
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Jan 2009
    Posts
    22
    thanks I will try the GTK source I just thought someone might have tried something like this before. I will keep everyone posted

  4. #4
    Linux User
    Join Date
    Nov 2008
    Location
    Tokyo, Japan
    Posts
    260
    Just out of curiosity, have you tried a "tiling" window manager? If you're not familiar with the term, it is basically a window placement algorithm that avoids overlapping windows, and has customizable routines for dividing the screen in half, thirds, quarters, etc. Every time a window appears, the layout is adjusted (for example a split screen might be re-split into thirds) and the window is placed in its section of the screen.

    I have been using XMonad (because I am absolutely obsessed with the Haskell programming language), but AwesomeWM is also a good one, and can be scripted with the Lua language. XMonad integrates nicely with Gnome (by simply replacing the "metacity" window manager), so you can keep your Gnome panel and all the other perks of a clean, stable desktop environment, but use a tiling window manager for ultimate productivity.

  5. #5
    Just Joined!
    Join Date
    Jan 2009
    Posts
    22
    I hadn't tried a tiling window manager, but as I said, the real problem is not placement, so much as the fact that the window actually goes off the screen, which i believe is drawn by gtk. I have yet to find the part in Gtk that actually does this, as of yet, so no progress so far. The main target for this will probably actually be running a full version of linux on my HTC Dream. It's screen size is 320x480, so I really need to be able to scale, and zoom, in real time. Would a tiling window manager do this? I know about the E desktop environment's ability to scale windows, but I would like GTK, if this is possible, of course. Thanks for the tip though.

  6. #6
    Linux User
    Join Date
    Nov 2008
    Location
    Tokyo, Japan
    Posts
    260
    I see, well I guess a tiling window manager cannot scale windows, it only handles window sizes and placement, not how the actual content is visible.

    I know gnome integrates well with the Compiz window manager -- its a compositing window manager, so you can definitely do scaling, and numerous other attractive window effects. Ubuntu uses Compiz in place of Metacity, but it needs decent OpenGL rendering hardware to run, so I guess that is not an option for you.

    Well, good luck.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •