Commit 7df9937e authored by Christoffer Ackelman's avatar Christoffer Ackelman

Fixed subwindow drawing in grow. subwindow_scale was initialized to 0 when it should be 1...

parent bd0620fc
......@@ -54,12 +54,28 @@ class DrawWindGtk : public DrawWind {
public:
DrawWindGtk()
{
subwindow_scale = 1;
memset(clip_rectangle, 0, sizeof(clip_rectangle));
}
GdkWindow* window = NULL;
GdkPixmap* buffer = NULL;
GdkRectangle clip_rectangle[DRAW_CLIP_SIZE];
GdkPixmap* background_pixmap = NULL;
DrawWind* copy() {
DrawWindGtk* tmp = new DrawWindGtk();
tmp->clip_on = this->clip_on;
tmp->clip_cnt = this->clip_cnt;
tmp->window = this->window;
tmp->buffer = this->buffer;
memcpy(tmp->clip_rectangle, this->clip_rectangle, sizeof(this->clip_rectangle));
tmp->background_pixmap = this->background_pixmap;
return tmp;
}
virtual void update_buffer(DrawWind* w) {
this->buffer = ((DrawWindGtk*)w)->buffer;
}
};
class GlowDrawGtk : public GlowDraw {
......
......@@ -60,6 +60,7 @@ class DrawWindQt : public DrawWind {
public:
DrawWindQt()
{
subwindow_scale = 1;
memset(clip_rectangle, 0, sizeof(clip_rectangle));
}
......@@ -67,6 +68,17 @@ public:
QImage* buffer = NULL;
QRect clip_rectangle[DRAW_CLIP_SIZE];
QPixmap* background_pixmap = NULL;
DrawWind* copy() {
DrawWindQt* tmp = new DrawWindQt();
tmp->clip_on = this->clip_on;
tmp->clip_cnt = this->clip_cnt;
tmp->window = this->window;
tmp->buffer = this->buffer;
memcpy(tmp->clip_rectangle, this->clip_rectangle, sizeof(this->clip_rectangle));
tmp->background_pixmap = this->background_pixmap;
return tmp;
}
};
class GlowCustomColorsQt;
......
......@@ -60,6 +60,9 @@ public:
double subwindow_scale; //!< Subwindow scale.
int clip_on = 0;
int clip_cnt = 0;
virtual DrawWind* copy() = 0;
virtual void update_buffer(DrawWind* w) {}
};
class GlowDraw {
......
......@@ -195,9 +195,12 @@ int GrowCtx::subw_event_handler(glow_eEvent event, int x, int y, int w, int h)
|| a[i]->type() == glow_eObjectType_GrowFolder
|| a[i]->type() == glow_eObjectType_GrowTable) {
switch (event) {
case glow_eEvent_Exposure:
if (a[i]->type() == glow_eObjectType_GrowWindow)
a[i]->event_handler(event, 0, 0, 0, 0);
break;
case glow_eEvent_Leave:
case glow_eEvent_Enter:
case glow_eEvent_Exposure:
case glow_eEvent_VisibilityUnobscured:
case glow_eEvent_VisibilityObscured:
break;
......
......@@ -582,6 +582,9 @@ int GrowWindow::event_handler(glow_eEvent event, int x, int y, double fx, double
int sts, v_sts, h_sts;
switch (event) {
case glow_eEvent_Exposure:
window_ctx->mw->update_buffer(ctx->mw);
return 1;
case glow_eEvent_Key_Right:
case glow_eEvent_Key_Left:
case glow_eEvent_Key_Up:
......@@ -916,8 +919,8 @@ void GrowWindow::new_ctx()
= new GrowCtx("WindowComponent", ctx->mw->zoom_factor_x * window_scale);
window_ctx->gdraw = ctx->gdraw;
window_ctx->is_subwindow = 1;
window_ctx->mw = ctx->mw;
window_ctx->navw = ctx->navw;
window_ctx->mw = ctx->mw->copy();
window_ctx->navw = ctx->navw->copy();
window_ctx->userdata_save_callback = ctx->userdata_save_callback;
window_ctx->userdata_open_callback = ctx->userdata_open_callback;
window_ctx->userdata_copy_callback = ctx->userdata_copy_callback;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment