[SDL_Tizen] Fix Indicator issue
[platform/upstream/SDL.git] / src / video / tizen / SDL_tizenopengles.c
index cb5cdc8..89a4164 100755 (executable)
@@ -353,19 +353,16 @@ void Tizen_DrawIndicator(SDL_Window *window)
         ecore_wl_window_rotation_change_done_send(wdata->window);
         wdata->received_rotation = 0;
     }
-
-    if(wdata->last_indicator_showtime + 3000< SDL_GetTicks())
-    {
-        ModelMatrixTranslate(&mMatrix, 0.0f, 0.02f, 0.0f);
-    }
-
-    if(wdata->last_indicator_showtime + 3500 <SDL_GetTicks()) {
-        wdata->indicator_show = SDL_FALSE;
-        _tizen_indicator_event_filter();
-    }
-
     if(!(window->flags & SDL_WINDOW_FULLSCREEN) && !(window->flags & SDL_WINDOW_BORDERLESS) && wdata->indicator_show)
     {
+        if(wdata->last_indicator_showtime + 3000< SDL_GetTicks())
+        {
+            ModelMatrixTranslate(&mMatrix, 0.0f, 0.02f, 0.0f);
+        }
+        if(wdata->last_indicator_showtime + 3500 <SDL_GetTicks()) {
+            wdata->indicator_show = SDL_FALSE;
+            _tizen_indicator_event_filter();
+        }
         GLES2_Context Mainctx;
         LoadContext(&Mainctx);
         Mainctx.glViewport(0, 0, window->w, window->h);
@@ -617,33 +614,33 @@ Tizen_GLES_DeleteContext(_THIS, SDL_GLContext context)
 void
 SDL_IndicatorProcessEvent(SDL_Window *window, int rot)
 {
-    GLES2_Context Mainctx;
-    LoadContext(&Mainctx);
-
     SDL_WindowData *wind = window->driverdata;
+    if(!(window->flags & SDL_WINDOW_FULLSCREEN) && !(window->flags & SDL_WINDOW_BORDERLESS) && wind->indicator_show)
+    {
+        GLES2_Context Mainctx;
+        LoadContext(&Mainctx);
 
-    double ratio = 0.92f;
-    if( rot == 90 || rot ==270)
-        ratio = 0.86f;
-
-    vVertices[4] = vVertices[7] = vVertices[16] = ratio;
-
-    Mainctx.glBindBuffer(GL_ARRAY_BUFFER, indicator_vbo);
-    Mainctx.glBufferData(GL_ARRAY_BUFFER, 18 * 4, vVertices, GL_STATIC_DRAW);
-    Mainctx.glBindBuffer(GL_ARRAY_BUFFER, indicator_ibo);
-    Mainctx.glBufferData(GL_ARRAY_BUFFER, 12 * 4, vCoord, GL_STATIC_DRAW);
+        double ratio = 0.92f;
+        if( rot == 90 || rot ==270)
+            ratio = 0.86f;
 
-    ModelMatrixLoadIdentity(&mMatrix);
+        vVertices[4] = vVertices[7] = vVertices[16] = ratio;
 
-    if (!wind->support_pre_rotation)
-        rotate_indicator(&mMatrix, 0, 0, rot);
+        Mainctx.glBindBuffer(GL_ARRAY_BUFFER, indicator_vbo);
+        Mainctx.glBufferData(GL_ARRAY_BUFFER, 18 * 4, vVertices, GL_STATIC_DRAW);
+        Mainctx.glBindBuffer(GL_ARRAY_BUFFER, indicator_ibo);
+        Mainctx.glBufferData(GL_ARRAY_BUFFER, 12 * 4, vCoord, GL_STATIC_DRAW);
 
-    wind->indicator_show = SDL_TRUE;
-    wind->last_indicator_showtime = SDL_GetTicks();
+        ModelMatrixLoadIdentity(&mMatrix);
 
+        if (!wind->support_pre_rotation)
+            rotate_indicator(&mMatrix, 0, 0, rot);
 
-    _tizen_indicator_event_filter();
+        wind->indicator_show = SDL_TRUE;
+        wind->last_indicator_showtime = SDL_GetTicks();
 
+        _tizen_indicator_event_filter();
+    }
 }
 
 #endif /* SDL_VIDEO_DRIVER_TIZEN && SDL_VIDEO_OPENGL_EGL */