From 3b4c5be19a8512cfbbe1a79d7cbbed7572da5840 Mon Sep 17 00:00:00 2001 From: raster Date: Sun, 28 Feb 2010 04:59:18 +0000 Subject: [PATCH] add fullscreen option for a fair number of engines - didnt do xcb - more work :( git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/expedite@46636 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/bin/engine_gl_sdl.c | 2 +- src/bin/engine_gl_x11.c | 10 ++++++++++ src/bin/engine_software_16_x11.c | 10 ++++++++++ src/bin/engine_software_sdl.c | 2 +- src/bin/engine_software_xcb.c | 4 ++-- src/bin/engine_software_xlib.c | 9 +++++++++ src/bin/engine_xrender_x11.c | 10 ++++++++++ src/bin/engine_xrender_xcb.c | 4 ++-- src/bin/main.c | 6 ++++++ src/bin/main.h | 1 + 10 files changed, 52 insertions(+), 6 deletions(-) diff --git a/src/bin/engine_gl_sdl.c b/src/bin/engine_gl_sdl.c index 79ed128..0dc9a73 100644 --- a/src/bin/engine_gl_sdl.c +++ b/src/bin/engine_gl_sdl.c @@ -14,7 +14,7 @@ engine_gl_sdl_args(const char *engine, int width, int height) einfo = (Evas_Engine_Info_GL_SDL *) evas_engine_info_get(evas); /* the following is specific to the engine */ - einfo->flags.fullscreen = 0; + einfo->flags.fullscreen = fullscreen; einfo->flags.noframe = 0; if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo)) diff --git a/src/bin/engine_gl_x11.c b/src/bin/engine_gl_x11.c index 6142db8..b96272a 100644 --- a/src/bin/engine_gl_x11.c +++ b/src/bin/engine_gl_x11.c @@ -2,6 +2,7 @@ #include #include +#include #include static Display *disp = NULL; @@ -60,6 +61,15 @@ engine_gl_x11_args(const char *engine, int width, int height) goto destroy_window; } + if (fullscreen) + { + Atom prop = XInternAtom(disp, "_NET_WM_STATE", False); + Atom state = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", False); + unsigned long data = state; + XChangeProperty(disp, win, prop, XA_ATOM, 32, PropModeReplace, + &data, 1); + } + XStoreName(disp, win, "Expedite - Evas Test Suite"); chint.res_name = "expedite"; chint.res_class = "Expedite"; diff --git a/src/bin/engine_software_16_x11.c b/src/bin/engine_software_16_x11.c index 2232067..a8bcdf5 100644 --- a/src/bin/engine_software_16_x11.c +++ b/src/bin/engine_software_16_x11.c @@ -2,6 +2,7 @@ #include #include +#include #include static Display *disp = NULL; @@ -56,6 +57,15 @@ engine_software_16_x11_args(const char *engine, int width, int height) goto destroy_window; } + if (fullscreen) + { + Atom prop = XInternAtom(disp, "_NET_WM_STATE", False); + Atom state = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", False); + unsigned long data = state; + XChangeProperty(disp, win, prop, XA_ATOM, 32, PropModeReplace, + &data, 1); + } + XStoreName(disp, win, "Expedite - Evas Test Suite"); chint.res_name = "expedite"; chint.res_class = "Expedite"; diff --git a/src/bin/engine_software_sdl.c b/src/bin/engine_software_sdl.c index 91a29df..b05c99e 100644 --- a/src/bin/engine_software_sdl.c +++ b/src/bin/engine_software_sdl.c @@ -23,7 +23,7 @@ engine_software_sdl_args(const char *engine, int width, int height) einfo = (Evas_Engine_Info_SDL *) evas_engine_info_get(evas); /* the following is specific to the engine */ - einfo->info.fullscreen = 0; + einfo->info.fullscreen = fullscreen; einfo->info.noframe = 0; if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo)) diff --git a/src/bin/engine_software_xcb.c b/src/bin/engine_software_xcb.c index 327fea1..e950713 100644 --- a/src/bin/engine_software_xcb.c +++ b/src/bin/engine_software_xcb.c @@ -127,8 +127,6 @@ engine_software_xcb_args(const char *engine, int width, int height) value_list); einfo->info.drawable = win; - xcb_map_window(conn, win); - if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo)) { printf("Evas can not setup the informations of the Software XCB Engine\n"); @@ -178,6 +176,8 @@ engine_software_xcb_args(const char *engine, int width, int height) free(xcb_get_input_focus_reply(conn, xcb_get_input_focus_unchecked(conn), NULL)); + xcb_map_window(conn, win); + while (!first_expose) engine_software_xcb_loop(); return EINA_TRUE; diff --git a/src/bin/engine_software_xlib.c b/src/bin/engine_software_xlib.c index 662c6e5..4e29380 100644 --- a/src/bin/engine_software_xlib.c +++ b/src/bin/engine_software_xlib.c @@ -2,6 +2,7 @@ #include #include +#include #include static Display *disp = NULL; @@ -62,6 +63,14 @@ engine_software_xlib_args(const char *engine, int width, int height) printf("Evas can not setup the informations of the Software Xlib Engine\n"); goto destroy_window; } + + if (fullscreen) + { + Atom prop = XInternAtom(disp, "_NET_WM_STATE", False); + Atom state = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", False); + unsigned long data = state; + XChangeProperty(disp, win, prop, XA_ATOM, 32, PropModeReplace, &data, 1); + } XStoreName(disp, win, "Expedite - Evas Test Suite"); chint.res_name = "expedite"; diff --git a/src/bin/engine_xrender_x11.c b/src/bin/engine_xrender_x11.c index 6bacfc8..3354b16 100644 --- a/src/bin/engine_xrender_x11.c +++ b/src/bin/engine_xrender_x11.c @@ -2,6 +2,7 @@ #include #include +#include #include static Display *disp = NULL; @@ -58,6 +59,15 @@ engine_xrender_x11_args(const char *engine, int width, int height) goto destroy_window; } + if (fullscreen) + { + Atom prop = XInternAtom(disp, "_NET_WM_STATE", False); + Atom state = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", False); + unsigned long data = state; + XChangeProperty(disp, win, prop, XA_ATOM, 32, PropModeReplace, + &data, 1); + } + XStoreName(disp, win, "Expedite - Evas Test Suite"); chint.res_name = "expedite"; chint.res_class = "Expedite"; diff --git a/src/bin/engine_xrender_xcb.c b/src/bin/engine_xrender_xcb.c index da2af93..4ea668f 100644 --- a/src/bin/engine_xrender_xcb.c +++ b/src/bin/engine_xrender_xcb.c @@ -142,8 +142,6 @@ engine_xrender_xcb_args(const char *engine, int width, int height) goto destroy_window; } - xcb_map_window(conn, win); - /* XStoreName(disp, win, "Expedite - Evas Test Suite"); */ cookie1 = xcb_intern_atom_unchecked(conn, 0, strlen("STRING"), "STRING"); @@ -209,6 +207,8 @@ engine_xrender_xcb_args(const char *engine, int width, int height) free(xcb_get_input_focus_reply(conn, xcb_get_input_focus_unchecked(conn), NULL)); + xcb_map_window(conn, win); + while (!first_expose) engine_xrender_xcb_loop(); return EINA_TRUE; diff --git a/src/bin/main.c b/src/bin/main.c index 57f670b..ec7a3df 100644 --- a/src/bin/main.c +++ b/src/bin/main.c @@ -3,6 +3,7 @@ Evas *evas = NULL; int win_w = 720, win_h = 420; int loops = LOOPS; +int fullscreen = 0; static char *datadir = NULL; static int go = 1; @@ -1230,6 +1231,7 @@ _help(void) " -t TEST-NUM\n" " -e ENGINE\n" " -p PROFILE\n" + " -f use netwm fullscreen request (requires x11 + wm)\n" "\n" "Where ENGINE can be one of:\n" " "); @@ -1273,6 +1275,10 @@ _profile_parse(int argc, char **argv) i++; loops = atoi(argv[i]); } + else if (!strcmp(argv[i], "-f")) + { + fullscreen = 1; + } } return 1; } diff --git a/src/bin/main.h b/src/bin/main.h index d6b946a..90ff32d 100644 --- a/src/bin/main.h +++ b/src/bin/main.h @@ -87,6 +87,7 @@ extern "C" extern Evas *evas; extern int win_w, win_h; extern int loops; +extern int fullscreen; typedef struct _Expedite_Resolution Expedite_Resolution; typedef struct _Expedite_Engine Expedite_Engine; -- 2.7.4