[Y-devel] Success report + resolution patch for sdl.c
Brandon Black brandon at tryplec.com
Fri Feb 20 14:31:30 GMT 2004
Yeah you can do whatever you want with any trivial patches like that
from me, I disclaim all rights to 5 minute efforts :)
Aaron wrote:
> Mind if I put this patch up on my http that I have started with some
> faqs and other patches? https://www.darkobjects.net/~drizzt/y-base/
>
> Aaron
>
> Brandon Black wrote:
>
>>
>> Another success to report. I'll list the complications I ran into,
>> some of which have already been echoed here:
>>
>> 1) The module shared objects get installed with no ".so" suffix by
>> make install on my system, had to manually rename them to get things
>> going
>> 2) Y doesn't start properly when I execute it normally and let it
>> detach to the background, haven't looked into why. My workaround so
>> far has just been to execute it as "Y --no-detach &"
>>
>> Also, I have my framebuffer set to 1024x768, and Y is currently
>> hardcoded to start up its SDL screen at 800x600. So there's a
>> trivial and ugly hack patch to allow the SDL screen resolution to be
>> set from the Y default.conf file at the bottom of this email. It
>> works for me to set my screen to 1024x768, YMMV :) After applying
>> this patch, I modify the sdl driver line in my default.conf like this:
>>
>> LoadModule "driver/video/sdl" res=1024x768
>>
>> The project looks promising if very rough and early, keep up the good
>> work :) Other than more low-level drivers and whatnot, has a list
>> been made of the next important things to work on? I wouldn't mind
>> putting some time in if it's something I can do. Here's a few basic
>> things I can think of off the top of my head:
>>
>> 1) An obvious one would be to write some native utilities (file
>> manager for example).
>> 2) Set up some default hotkeys for a few things in the Y server (like
>> ctrl+alt+backspace to kill server ala xfree86).
>> 3) Set up a popup context menu on the desktop (in the wm code?) with
>> a simple menu like many X window managers have (maybe a shutdown
>> item, a client killer, and some basic neccesity client spawn commands
>> like yiterm)
>> 4) Set up an applications menu / dockbar / etc (startbar) type of
>> thing (again in the wm code I guess?) - something with a menu that
>> can be configured per-user for the applications you want to launch,
>> and perhaps a window/task list, etc.
>>
>> Anyone working on any of this already, or have any other good basic
>> ideas along these lines?
>>
>> Brandon
>>
>> diff -ur Y--devel--0.2--patch-1/modules/drivers/video/sdl/sdl.c
>> myY/modules/drivers/video/sdl/sdl.c
>> --- Y--devel--0.2--patch-1/modules/drivers/video/sdl/sdl.c
>> 2004-01-29 15:30:13.000000000 -0600
>> +++ myY/modules/drivers/video/sdl/sdl.c 2004-02-20 03:04:11.000000000
>> -0600
>> @@ -285,6 +285,10 @@
>> initialise (struct Module *module, int argc, const char **argv)
>> {
>> struct VideoDriver *videodriver;
>> + char* res=NULL;
>> + int screenx=800;
>> + int screeny=600;
>> + int i;
>>
>> if ( SDL_Init(SDL_INIT_EVERYTHING) < 0 )
>> {
>> @@ -296,7 +300,25 @@
>> videodriver -> d = ymalloc (sizeof (struct SDLVideoDriverData));
>> videodriver -> module = module;
>>
>> - sdlData(videodriver) -> sdlSurface = SDL_SetVideoMode(800, 600,
>> 32, SDL_HWSURFACE|SDL_DOUBLEBUF|SDL_RESIZABLE);
>> + for (i=0; i<argc; ++i)
>> + {
>> + if (strncmp (argv[i], "res=", 4) == 0)
>> + res = strdup(argv[i] + 4);
>> + }
>> +
>> + if(res) {
>> + char* xloc=strchr(res,'x');
>> + if(!xloc) {
>> + Y_ERROR ("sdl: can't parse resolution string %s:",res);
>> + } else {
>> + screeny=atoi(xloc+1);
>> + xloc=NULL;
>> + screenx=atoi(res);
>> + Y_ERROR ("sdl: Setting resolution to %i x %i",screenx,screeny);
>> + }
>> + }
>> +
>> + sdlData(videodriver) -> sdlSurface = SDL_SetVideoMode(screenx,
>> screeny, 32, SDL_HWSURFACE|SDL_DOUBLEBUF|SDL_RESIZABLE);
>>
>> SDL_WM_SetCaption ("Y on SDL", NULL);
>>
>>
>>
>> _______________________________________________
>> Y-devel mailing list
>> Y-devel at www.y-windows.org
>> https://www.y-windows.org/mailman/listinfo/y-devel
>
More information about the Y-devel mailing list
2026 © www.Y-Windows.Org - All Rights Reserved